This commit is contained in:
parent
6721e9d7c6
commit
e5e8981ba5
|
|
@ -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).*)']
|
||||
// }
|
||||
Loading…
Reference in New Issue