Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pnpm-lock.yaml @nodejs/web-infra
# Framework
apps/site/next.config.mjs @nodejs/web-infra
apps/site/next.dynamic.mjs @nodejs/web-infra
apps/site/middleware.ts @nodejs/web-infra
apps/site/proxy.ts @nodejs/web-infra
apps/site/navigation.mjs @nodejs/web-infra
apps/site/playwright.config.ts @nodejs/web-infra

Expand Down
7 changes: 5 additions & 2 deletions apps/site/middleware.ts → apps/site/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import createMiddleware from 'next-intl/middleware';

import { availableLocaleCodes, defaultLocale } from '#site/next.locales.mjs';

export default createMiddleware({
// The middleware file convention is deprecated and has been renamed to proxy
// See: https://nextjs.org/docs/messages/middleware-to-proxy

export const proxy = createMiddleware({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const proxy = createMiddleware({
export default createMiddleware({

Just leave as it was 😅

// A list of all locales that are supported
locales: availableLocaleCodes,

Expand All @@ -17,6 +20,6 @@ export default createMiddleware({
alternateLinks: false,
});

// We only want the middleware to run on the `/` route
// We only want the proxy to run on the `/` route
// to redirect users to their preferred locale
export const config = { matcher: ['/'] };