diff --git a/internal/api/httpserver.go b/internal/api/httpserver.go index 62c654b..48a8598 100644 --- a/internal/api/httpserver.go +++ b/internal/api/httpserver.go @@ -21,7 +21,7 @@ type Server struct { // New creates a new Server, initializes it and returns it. func NewHttpServer(p ProcessFunc) *Server { - api := &Server{processFunc: p} + api := &Server{processFunc: p, App: app.New()} api.Use(logger.New()) api.Post("/listen", api.requestHandler) return api diff --git a/internal/api/httpserver_test.go b/internal/api/httpserver_test.go new file mode 100644 index 0000000..94bfc37 --- /dev/null +++ b/internal/api/httpserver_test.go @@ -0,0 +1,14 @@ +package api + +import ( + "io" + "testing" +) + +func TestNewHttpServer(t *testing.T) { + fn := func(r io.ReadCloser) error { + return nil + } + + NewHttpServer(fn) +}