how to implement different middleware to handle app page routes and api routes.
Unanswered
Cape lion posted this in #help-forum
Cape lionOP
The documentation says that we can have only one middleware.ts but we can separate it as per modules and import the middleware in the main middleware.ts . I tried but it’s not working for me probably my implementation might be incorrect. Any sample code or help to implemented the same ?
3 Replies
@Ray check this out
https://github.com/hoangvvo/next-connect#nextjs-middleware
Cape lionOP
Any example without using an external package ?
@Cape lion Any example without using an external package ?
You could look into their source code