From e5e8981ba5434a2fff8888d465562b1a659fe3ae Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 13 Mar 2025 22:33:25 +0800 Subject: [PATCH] . --- apps/blogai/middleware.ts | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/apps/blogai/middleware.ts b/apps/blogai/middleware.ts index 75f39a0..157e45d 100644 --- a/apps/blogai/middleware.ts +++ b/apps/blogai/middleware.ts @@ -1,42 +1,20 @@ -// export { auth as middleware } from './auth' - -// export const config = { -// matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'] -// } - import { i18nRouter } from 'next-i18n-router'; import i18nConfig from './i18nConfig'; import { NextResponse, NextRequest, NextFetchEvent } from 'next/server' // This function can be marked `async` if using `await` inside export function middleware(req: NextRequest, evt: NextFetchEvent) { - // return NextResponse.redirect(new URL('/home', request.url)) - console.log(` - ======> - ${req.url} - ${JSON.stringify(req)} - ${req.nextUrl.pathname} - `) + // console.log(` + // ======> + // ${req.url} - ${JSON.stringify(req)} - ${req.nextUrl.pathname} + // `) return i18nRouter(req, i18nConfig); } - - -// export const config = { -// matcher: [ -// "/app", -// "/app/(.*)", -// "/auth/(.*)", -// "/(api|trpc)(.*)", -// "/((?!_next/static|_next/image|images|favicon.ico|$).*)", -// ], -// }; - // only applies this middleware to files in the app directory export const config = { matcher: '/((?!api|static|.*\\..*|_next).*)' }; -// export const config = { -// matcher: ['/((?!api|_next/static|_next/image|favicon.ico|favicon.png).*)'] -// } \ No newline at end of file