aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorAnthony Wang2023-04-24 15:39:34 -0400
committerAnthony Wang2023-04-24 15:39:34 -0400
commitf2414e8a6b6276825efcc2b7132683ce15289537 (patch)
treeb4544f868a51f9bc9aa89bd464694625e4f5805d /server
parent5cb3dff9d3f1a748272ffb490a1c3212ef2a019f (diff)
Start working on Go implementation
Diffstat (limited to 'server')
-rw-r--r--server/server.go17
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))
+}