Next.js Discord

Discord Forum

Middleware.tsx

Answered
Varun posted this in #help-forum
Open in Discord
Avatar
VarunOP
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?
Image
Answered by Ray
it should be at the root of directory
/middleware.ts
View full answer

3 Replies

Avatar
Ray
it should be at the root of directory
/middleware.ts
Answer
Avatar
Ray
or src/middleware.ts if you are using src folder
Avatar
VarunOP
thanks!