-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with middlewares #33
Labels
Comments
Closed
Hi, I'm facing this issue too. I would like to add some authorization requirements to access the healthchecker url. Is there any update about this ? |
Hi, We must to be able to use our middlewares on health route. Any updates regarding the fix? |
Resolved in 7.0.0 🎉 Terminus v7 now uses the native NestJS route handler, therefore you can use the middleware as you are used to with NestJS! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm submitting a...
Current behavior
Add a middleware via app.use() [with or without the FastifyAdapter], e.g:
app.use((req, res, next) => { logger.info("This is a request."); next(); });
Then call /health/readiness (or any terminus routes). No message is logged for terminus routes (but it is for other custom routes).
Note: I also have morgan set up for more convenient request logging, it doesn't work either. Version:
Expected behavior
The above middleware should log "This is a request" to the console on every request to a terminus route.
Minimal reproduction of the problem with instructions
See "Current behavior".
What is the motivation / use case for changing the behavior?
Using middlewares is supported by nest, and logging requests is useful for debugging, bug tracing, etc., so it would be a great addition/fix.
Environment
The text was updated successfully, but these errors were encountered: