Skip to content

Commit 4c3ac41

Browse files
committed
create default server with middlewares and prometeous
1 parent 2550743 commit 4c3ac41

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/http.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type HTTPServer struct {
3030
func InitAndRun() fx.Option {
3131
return fx.Module(component,
3232
// Init http server
33-
fx.Provide(New),
33+
fx.Provide(NewServerWithMiddlewares),
3434
fx.Invoke(
3535
// Registration routes and handlers for http server
3636
InitHandlerGroups,
@@ -110,6 +110,7 @@ func AddPrometheus(e *echo.Echo) *echo.Echo {
110110
// Add prometheus metrics
111111
e.Use(echoprometheus.NewMiddleware(component))
112112
e.GET("/metrics", echoprometheus.NewHandler())
113+
return e
113114
}
114115

115116
func AddDefaultMiddlewares(e *echo.Echo) *echo.Echo {
@@ -126,6 +127,7 @@ func AddDefaultMiddlewares(e *echo.Echo) *echo.Echo {
126127
c.SetRequest(c.Request().WithContext(ctx))
127128
},
128129
}))
130+
return e
129131
}
130132

131133
// StartServer is function that registers start of http server in lifecycle

0 commit comments

Comments
 (0)