Skip to content

Commit 2be7912

Browse files
committed
docs: clarify middleware location (root or /src; /app not supported)
1 parent 6316c4b commit 2be7912

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/01-app/03-api-reference/03-file-conventions/middleware.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export const config = {
4848

4949
## Exports
5050

51-
### Middleware function
51+
> **Note**
52+
> Place `middleware.{js,ts}` at the project root or inside `src/` at the same level as `app` or `pages`. See: [Getting Started → Route Handlers and Middleware → Convention](https://nextjs.org/docs/app/getting-started/route-handlers-and-middleware#convention).
5253
5354
The file must export a single function, either as a default export or named `middleware`. Note that multiple middleware from the same file are not supported.
5455

0 commit comments

Comments
 (0)