diff options
author | Anthony Wang | 2023-04-24 15:39:34 -0400 |
---|---|---|
committer | Anthony Wang | 2023-04-24 15:39:34 -0400 |
commit | f2414e8a6b6276825efcc2b7132683ce15289537 (patch) | |
tree | b4544f868a51f9bc9aa89bd464694625e4f5805d /server | |
parent | 5cb3dff9d3f1a748272ffb490a1c3212ef2a019f (diff) |
Start working on Go implementation
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go new file mode 100644 index 0000000..709888b --- /dev/null +++ b/server/server.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "html" + "log" + "net/http" +) + +func handler(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) +} + +func main() { + http.HandleFunc("/", handler) + log.Fatal(http.ListenAndServe(":8080", nil)) +} |