Skip to content

Commit

Permalink
docs: Update middleware.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn authored Nov 19, 2024
1 parent e2be6aa commit c6370f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/pages/docs/routing/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const handleI18nRouting = createMiddleware(routing);
export default function middleware(request: NextRequest) {
const {pathname} = request.nextUrl;

// Matches '/', as well as all paths that start with a locale like '/en'
const shouldHandle =
pathname === '/' ||
new RegExp(`^/(${locales.join('|')})(/.*)?$`).test(
Expand Down

0 comments on commit c6370f0

Please sign in to comment.