add http server & test
This commit is contained in:
3
e2e/basic.hurl
Normal file
3
e2e/basic.hurl
Normal file
@@ -0,0 +1,3 @@
|
||||
GET http://localhost:8080/foo
|
||||
HTTP 200
|
||||
`Hello, "/foo"`
|
||||
12
main.go
12
main.go
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user