Next.js Discord

Discord Forum

Is it possible to have more than 1 middleware files?

Answered
In&Out posted this in #help-forum
Open in Discord
Is it possible to have more than 1 middleware files? If so, how to do it?
Answered by aardani
Next.js will only and only read one milddleware.ts file. You can still import from other files to that middleware.ts file
View full answer

4 Replies

Song Sparrow
hey did you figure it out?

For context, I'm looking to add Clerk's authentication middleware + internationalization (https://github.com/vercel/next.js/tree/canary/examples/app-dir-i18n-routing)
Next.js will only and only read one milddleware.ts file. You can still import from other files to that middleware.ts file
Answer
Okay thanks