-
-
Notifications
You must be signed in to change notification settings - Fork 765
Open
Labels
Description
Describe the feature
Middleware can be applied globally or via object syntax at the moment. This makes route (group) based middleware hard to apply and possibly error prone, e.g. forgetting to add authorization to a single endpoint could lead to a security issue and code repetition.
Instead, having route-based middleware with the suffix pattern routes/[server].middleware.ts automatically apply to the route (and all possible child routes) would be helpful, reducing the need for code duplicates and risk of forgetting to add middleware.
Additional information
- Would you be willing to help implement this feature?
pi0coderabbitai