add http server & test

This commit is contained in:
2025-10-27 22:31:36 +02:00
parent dedf80c8f9
commit cc57d50ca8
2 changed files with 13 additions and 2 deletions

3
e2e/basic.hurl Normal file
View File

@@ -0,0 +1,3 @@
GET http://localhost:8080/foo
HTTP 200
`Hello, "/foo"`

12
main.go
View File

@@ -1,7 +1,15 @@
package main
import "fmt"
import (
"fmt"
"html"
"log"
"net/http"
)
func main() {
fmt.Println("Hello world!")
http.HandleFunc("/foo", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
})
log.Fatal(http.ListenAndServe(":8080", nil))
}