Next.js Discord

Discord Forum

Middleware.tsx

Answered
Varun posted this in #help-forum
Open in Discord
I don't see a middleware.tsx created in my project and generally I read that it is supposed to be on the same level as the pages folder. Would the equivalent of my pages folder be app?
Answered by Ray
it should be at the root of directory
/middleware.ts
View full answer

3 Replies

Answer
or src/middleware.ts if you are using src folder
thanks!