Back to Next Js

middleware.js

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

16.3.0582 B
Original Source

The middleware.js file convention has been deprecated in Next.js 16 and renamed to proxy.js.

All functionality remains the same — only the file and export names have changed. See the Migration to Proxy section for details on how to migrate.

You can automatically migrate by running:

bash
npx @next/codemod@canary middleware-to-proxy .

For full documentation, see the proxy.js API reference.