Replies: 1 comment 1 reply
-
The idea of middlewares is that they are applied to all incoming requests before routes are actually resolved and after a response has been produced by handlers (if a handler is indeed matched by the current route). If some handlers only need certain behaviors or checks, I would suggest making use of a base handler class or a shared concern module. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example, all
admin:
routes could have a middleware that checks user role, and allapi:
routes could have one that checks that accepted content-type is JSON.Beta Was this translation helpful? Give feedback.
All reactions