fix: exclude api routes from locale redirect
This commit is contained in:
@@ -14,7 +14,7 @@ export function middleware(request: NextRequest) {
|
|||||||
|
|
||||||
if (pathnameHasLocale) return;
|
if (pathnameHasLocale) return;
|
||||||
|
|
||||||
if (pathname.includes("sw.js") || pathname.includes("workbox")) return NextResponse.next();
|
if (pathname.startsWith("/api") || pathname.includes("sw.js") || pathname.includes("workbox")) return NextResponse.next();
|
||||||
|
|
||||||
// Redirect if there is no locale
|
// Redirect if there is no locale
|
||||||
const locale = defaultLocale; // For simplicity, we default to 'de' as requested
|
const locale = defaultLocale; // For simplicity, we default to 'de' as requested
|
||||||
|
|||||||
Reference in New Issue
Block a user