Skip to content

Commit

Permalink
fix: remove next static + api from middleware matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
MartianGreed committed Sep 17, 2024
1 parent 0de1c3a commit 6bb3841
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion apps/arkmarket/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ChainId, CollectionAddresses } from './config/homepage';

// This function can be marked `async` if using `await` inside
export function middleware(request: NextRequest) {

// index 0 is the first / at index 1 we got collection name
const splittedPath = request.nextUrl.pathname.split('/')
const collectionName = splittedPath[1] as Collections;
Expand All @@ -17,3 +16,16 @@ export function middleware(request: NextRequest) {

return NextResponse.rewrite(request.nextUrl.origin + '/token/' + address + '/' + splittedPath[2])
}

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).*)',
],
}
2 changes: 1 addition & 1 deletion packages/ui/src/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export const Discord =
<svg
stroke="currentColor"
fill="none"
stroke-width="0"
strokeWidth="0"
viewBox="0 0 15 15"
height="24px"
width="24px"
Expand Down

0 comments on commit 6bb3841

Please sign in to comment.