I am using below code in my middleware.js file in next.js application. Ideal when I go http://localhost:3000/home it should redirect to http://localhost:3000/, but it seems like my middleware is not triggering.
Here is my file structure
GSPANN+Abodh.shah@NODE1363 MINGW64 /d/camdiumUI/application/frontend (main)
$ ls
README.md components/ middleware.js next.config.js node_modules/ package-lock.json package.json pages/ public/ redux/ styles/ utils/
export function middleware(request) {
console.log(1)
return NextResponse.redirect(new URL('/', request.url))
}
// See "Matching Paths" below to learn more
export const config = {
matcher: ['/home'],
}