initial commit

This commit is contained in:
2025-05-29 14:52:06 +02:00
commit 113ac95610
4 changed files with 32 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package main
import (
"encoding/json"
"net/http"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello, World!"))
})
mux.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(map[string]string{"message": "Hello, World!"})
})
http.ListenAndServe(":8080", mux)
}