init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { NextResponse, NextRequest } from 'next/server';
|
||||
import { cookies } from 'next/headers'
|
||||
import createIntlMiddleware from 'next-intl/middleware'
|
||||
import { routing } from '@/i18n/routing'
|
||||
|
||||
const intlMiddleware = createIntlMiddleware(routing);
|
||||
|
||||
export default async function proxy(request: NextRequest) {
|
||||
const path = request.nextUrl.pathname;
|
||||
|
||||
if (
|
||||
path.startsWith('/_next') ||
|
||||
path.includes('/api/') ||
|
||||
path.includes('.')
|
||||
) {
|
||||
return NextResponse.next()
|
||||
}
|
||||
|
||||
const intlResponse = intlMiddleware(request);
|
||||
|
||||
if (intlResponse) {
|
||||
return intlResponse
|
||||
}
|
||||
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: ['/((?!api|_next/static|_next/image|.*\\.png$).*)']
|
||||
};
|
||||
Reference in New Issue
Block a user