Initial HTTP server

This commit is contained in:
Ian Gulliver
2022-03-16 03:32:03 +00:00
parent de51449f7d
commit b61359cd73
2 changed files with 22 additions and 2 deletions

20
main.go
View File

@@ -3,5 +3,25 @@ package main
// import "fmt"
// import "github.com/google/uuid"
import "flag"
import "log"
import "net/http"
var bindFlag = flag.String("listen", "[::]:8100", "host:port to listen on")
func main() {
flag.Parse()
mux := http.NewServeMux()
srv := &http.Server{
Addr: *bindFlag,
Handler: mux,
}
log.Printf("listening on %s", *bindFlag)
err := srv.ListenAndServe()
if err != nil {
log.Fatal(err)
}
}

View File

@@ -38,7 +38,7 @@ func TestStore(t *testing.T) {
}
if out1.Opaque != "foo" {
t.Errorf("Mismatach: %+v", out1)
t.Errorf("%+v", out1)
}
out2 := &storeTest{
@@ -51,7 +51,7 @@ func TestStore(t *testing.T) {
}
if out2.Opaque != "bar" {
t.Errorf("Mismatach: %+v", out2)
t.Errorf("%+v", out2)
}
}