Next.js importing Middleware into Middleware.ts
Unanswered
Yacare Caiman posted this in #help-forum
Yacare CaimanOP
Im importing _Middleware.ts files from my file system structure for my Authorization system. When i import these, can i still define matchers and have them conditionally apply. Or do i have to find a programmatic way to match thier routes?
1 Reply
@Yacare Caiman Im importing _Middleware.ts files from my file system structure for my Authorization system. When i import these, can i still define matchers and have them conditionally apply. Or do i have to find a programmatic way to match thier routes?
The export matcher syntax only works in the middleware.ts file proper. So as long as you export it in the middleware.ts file, it should work