Skip to content

UseAfter or afterRoutesInits #1611

Answered by Romakita
zantler asked this question in Q&A
Oct 28, 2021 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

Hello @zantler

This is the base of express.js and middlewares ^^. Unfortunatly, the chance to execute the middleware at the end of the list is low. The middlewares are only execute until that the response isn’t sent to your consummer.

So middlewares added via $afterRoutesInit hook are pushed after all routes and it’s generally to late to do something. Especially if you want to log something.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@zantler
Comment options

@Romakita
Comment options

@zantler
Comment options

@Romakita
Comment options

@zantler
Comment options

Answer selected by zantler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants