Skip to content

Commit

Permalink
again
Browse files Browse the repository at this point in the history
  • Loading branch information
aeolianeth committed Nov 17, 2024
1 parent ca9a577 commit 8e98d8a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ const HANDLE_REGEX = new RegExp(/\/@([^/]+).*/)

const logger = getLogger('middleware/page')

const GEOFENCED_PROJECT_IDS = [{ projectId: 64, blockedCountries: ['AU'] }]
const GEOFENCED_PROJECT_IDS: {
path: string
projectId: number
blockedCountries: string[]
}[] = [
// { path: '/v2/p/64', projectId: 64, blockedCountries: ['AU'] }, // example
]

function geofenceCheck(projectId: number, request: NextRequest) {
const url = request.nextUrl
Expand Down Expand Up @@ -101,5 +107,5 @@ export async function middleware(request: NextRequest) {
}

export const config = {
matcher: ['/@(.*)','/v2/p/64']
matcher: ['/@(.*)', ...GEOFENCED_PROJECT_IDS.map(p => p.path)],
}

0 comments on commit 8e98d8a

Please sign in to comment.