Files
myeasycms-v2/apps/web/middleware.ts
Zaid Marzguioui 4450776826
Some checks failed
Workflow / ⚫️ Test (push) Has been cancelled
Workflow / ʦ TypeScript (push) Has been cancelled
fix(i18n): add next-intl middleware for locale routing
The middleware was deleted in the Next.js 16 upgrade but is still required
by next-intl to handle locale detection and URL rewriting. Without it,
/auth/sign-in can't resolve to [locale=de]/auth/sign-in → 404.

Uses createMiddleware from next-intl/middleware with the shared routing config.
2026-03-31 22:47:55 +02:00

16 lines
366 B
TypeScript

import createMiddleware from 'next-intl/middleware';
import { routing } from '@kit/i18n/routing';
export default createMiddleware(routing);
export const config = {
matcher: [
// Match all pathnames except:
// - API routes (/api/...)
// - Next.js internals (/_next/...)
// - Static files with extensions
'/((?!api|_next|.*\\..*).*)',
],
};