Skip to content
Closed
Changes from 1 commit
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
8 changes: 6 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,11 @@ import createMiddleware from 'next-intl/middleware';

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

export default createMiddleware({
// Migrated from middleware.ts to proxy.ts as per Next.js 16 deprecation
Comment thread
ovflowd marked this conversation as resolved.
Outdated
// 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
Copy Markdown
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 +21,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: ['/'] };