Skip to content

Commit

Permalink
Merge pull request #59 from bigcommerce/CPX-1133
Browse files Browse the repository at this point in the history
CPX-1133 add matcher to middleware
  • Loading branch information
adambilsing authored Sep 13, 2024
2 parents 0ce155b + 06e2101 commit 9016cd1
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 9016cd1

Please sign in to comment.