This commit is contained in:
2024-12-20 01:15:56 +01:00
parent 39015d66ae
commit a711e5742d
3 changed files with 103 additions and 0 deletions

25
cmd/main.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"fmt"
"net/http"
)
func test(w http.ResponseWriter, req *http.Request) {
for name, headers := range req.Header {
for _, h := range headers {
fmt.Fprintf(w, "%v: %v\n", name, h)
}
}
}
func main() {
http.HandleFunc("/test", test)
// Serve files from the "static" directory
fs := http.FileServer(http.Dir("./static"))
http.Handle("/", http.StripPrefix("/", fs))
http.ListenAndServe(":8090", nil)
}