Skip to content

Commit

Permalink
CPX-1133 add matcher to middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bilsing committed Sep 13, 2024
1 parent 1e08475 commit ff79976
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,18 @@ export async function middleware(request: NextRequest) {

return response
}

export const config = {
matcher: [
/*
* Match all request paths except for the ones starting with:
* - api (API routes)
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico, sitemap.xml, robots.txt (metadata files)
*/
'/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)',
'/api/generateDescription',
'/',
],
}

0 comments on commit ff79976

Please sign in to comment.