add http server

This commit is contained in:
leah 2022-01-26 17:00:22 +00:00
parent e9e99646cb
commit 4c10954036
1 changed files with 15 additions and 0 deletions

15
main.go Normal file
View File

@ -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)
}