go-web-app-antipatterns
go-web-app-antipatterns copied to clipboard
Fix middleware order: Move Logger before Recoverer
This PR addresses an issue with the order of middleware in the router setup. According to the chi documentation, the Logger middleware should be placed before any other middleware that may change the response, such as Recoverer middleware. In the current implementation, the Logger middleware is placed after the Recoverer middleware, which may result in incorrect logging behavior.
Changes made:
- Moved the Logger middleware before the Recoverer middleware in the router setup.
By making this change, the middleware order will now be in compliance with chi's recommendations, ensuring proper logging behavior.