Replies: 2 comments 2 replies
-
This was the initial design for middleware, all the way back in Pages Router, version 12, but it was reworked to only root middleware, you can read more about it here: |
Beta Was this translation helpful? Give feedback.
-
That's a terrible idea. Not only is one middleware simply not enough, but it is also not convenient. For example, to set cookies I need to use either middleware for a couple of pages, which is one for the whole project, because I can't set cookies in server components, or use a client component, which makes no sense at all to make it a client component, except in this situation. |
Beta Was this translation helpful? Give feedback.
-
multiple middleware with app directory like page.tsx we have middleware.tsx for every route
Beta Was this translation helpful? Give feedback.
All reactions