From 4c1095403624396dc42664b97067c0bd0b7a26ac Mon Sep 17 00:00:00 2001 From: leah Date: Wed, 26 Jan 2022 17:00:22 +0000 Subject: [PATCH] add http server --- main.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..0fde6a1 --- /dev/null +++ b/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "html" + "net/http" +) + +func main() { + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + }) + + http.ListenAndServe("0.0.0.0:8080", nil) +}