diff --git a/examples/gifs/main.go b/examples/gifs/main.go index 38b64cf..cda4672 100644 --- a/examples/gifs/main.go +++ b/examples/gifs/main.go @@ -1,7 +1,6 @@ package main import "fmt" -import "log" import "net/http" import "hnakra/service" @@ -11,13 +10,9 @@ func main () { http.HandleFunc("/gifs/", gifs) http.Handle("/gifs/static/", http.StripPrefix("/gifs/static", static)) - err := service.NewHTTP ( + service.NewService ( "Gifs", "Serves a lot of big gifs on one page.", - "@", "/gifs/").Run() - - if err != nil { - log.Println("XXX", err) - } + service.NewHTTP("@", "/gifs/", nil)).Run() } func gifs (res http.ResponseWriter, req *http.Request) { diff --git a/examples/hellorld/main.go b/examples/hellorld/main.go index 2732e5e..d882a1a 100644 --- a/examples/hellorld/main.go +++ b/examples/hellorld/main.go @@ -1,16 +1,13 @@ package main -import "log" import "net/http" import "hnakra/service" func main () { http.HandleFunc("/hello/", hellorld) - err := service.NewHTTP("Hellorld", "A test service.", "@", "/hello/").Run() - - if err != nil { - log.Println("XXX", err) - } + service.NewService ( + "Hellorld", "A test service.", + service.NewHTTP("@", "/hello/", nil)).Run() } func hellorld (res http.ResponseWriter, req *http.Request) { diff --git a/examples/image/main.go b/examples/image/main.go index 96daf92..b50d7d0 100644 --- a/examples/image/main.go +++ b/examples/image/main.go @@ -1,6 +1,5 @@ package main -import "log" import "net/http" import "hnakra/service" @@ -13,10 +12,7 @@ func main () { // do with how *something* is caching the file. http.ServeFile(res, req, "fractal.png") }) - - err := service.NewHTTP ( - "Image", - "Displays an image of a fractal.", - "@", "/fractal.png").Run() - if err != nil { log.Println("XXX", err) } + service.NewService ( + "Image", "Displays an image of a fractal.", + service.NewHTTP("@", "/fractal.png", nil)).Run() } diff --git a/examples/kamikaze/main.go b/examples/kamikaze/main.go index 554320e..bf7df81 100644 --- a/examples/kamikaze/main.go +++ b/examples/kamikaze/main.go @@ -6,12 +6,10 @@ import "hnakra/service" func main () { http.HandleFunc("/kamikaze/", hellorld) - - err := service.NewHTTP ( + service.NewService ( "Kamikaze", "A service that abrupltly closes upon any request, for testing.", - "@", "/kamikaze/").Run() - if err != nil { log.Println("XXX", err) } + service.NewHTTP("@", "/kamikaze/", nil)).Run() } func hellorld (res http.ResponseWriter, req *http.Request) {