Skip to content

Commit

Permalink
fix middleware load order
Browse files Browse the repository at this point in the history
  • Loading branch information
Azuki-bar committed Nov 21, 2023
1 parent 7f80f7e commit ea67daa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions backend/state-manager/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ func main() {
r := chi.NewRouter()
// r.Use(middleware.Recoverer)
r.Use(middleware.Heartbeat("/debug/ping"))
r.Mount("/debug", middleware.Profiler())
r.Handle(statev1connect.NewStateManagerServiceHandler(&connectHandler.StateManagerServer{DBHandler: DBHandler, MqttHandler: mqttHandler}))
r.Use(httplog.RequestLogger(
httplog.NewLogger(
"http_server",
Expand All @@ -143,7 +141,7 @@ func main() {
),
)
r.Mount("/debug", middleware.Profiler())
r.Handle(statev1connect.NewStateManagerServiceHandler(&connectHandler.StateManagerServer{}))
r.Handle(statev1connect.NewStateManagerServiceHandler(&connectHandler.StateManagerServer{DBHandler: DBHandler, MqttHandler: mqttHandler}))

srv := &http.Server{
Addr: net.JoinHostPort("0.0.0.0", "8080"),
Expand Down

0 comments on commit ea67daa

Please sign in to comment.