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 0fc20d7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ 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 0fc20d7

Please sign in to comment.