guzba/mummy

[Question/FR?] middleware/route groups?

ITwrx opened this issue · 1 comments

ITwrx commented

I tried to implement middleware with route groups, but mummy's RequestHandler only expects Request to be passed, so i was unable to pass a secondary handler id. My simple/naive idea was to pass all routes for a protected group (/admin, for example) through a middleware proc that would check for auth, and if succeeded, pass request to correct RequestHandler proc.

Are middlewares and route groups already supported some way, and i'm just not seeing how to do it, or is this something that could use/would require some new code for mummy? For now, i just decided to check auth on every protected route's RequestHandler proc, but this is a little bothersome to my OCD. :)

ITwrx commented

It looks like this thorough and well-commented example may answer all my questions on middleware/custom handlers, and custom responses. Closing for now. thanks a lot, @guzba !