Next.jsMiddleware
createNextMiddleware()
API Reference for the createNextMiddleware() method.
Overview
createNextMiddleware()
is a utility function that creates a middleware function for use with Next.js.
It allows you to add a different route for each locale in your Next.js application.
For example, a french user would be directed to /fr/landing
and an english user would be directed to /en/landing
.
For more information on how to use this middleware, see the i18n routing guide.
Notes
- The
createNextMiddleware()
function is a utility function that creates a middleware function for use with Next.js.
Next steps
- See instructions on how to add i18n routing to your Next.js application.