#Fresh Logging Middleware

6 messages · Page 1 of 1 (latest)

elfin patrol
#

if you have the same code you gave in both middlewares, accessing a/* will cause the least specific middleware to trigger first and the next middleware will trigger on ctx.next()

#

with the way your code is written the console debug will indeed execute like a stack. Last in first out

#

if you moved the console logging to before ctx.next() it will behave like layers because that is executed before all the more specific middleware.

elfin patrol
#

I'm not suggesting that you do that, from what I understand you're confused about something here and I'm not sure what. I'm confused about your confusion XD

elfin patrol
#

I did some testing with the middleware when I read your post and it worked as expected for me, do you have a repository to share that I can look at and test myself?