Skip to content

Commit

Permalink
fix: redirect pathname
Browse files Browse the repository at this point in the history
  • Loading branch information
apotdevin committed Jun 18, 2024
1 parent 6b441ca commit c00e591
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@ export function middleware(request: NextRequest) {
if (request.nextUrl.pathname.startsWith('/api/graphql')) {
return NextResponse.rewrite(
new URL(
`${process.env.SERVER_URL}/api/graphql` ||
`${process.env.SERVER_URL}${request.nextUrl.pathname}` ||
'http://localhost:5000/api/graphql'
)
);
}
if (request.nextUrl.pathname.startsWith('/.well-known')) {
return NextResponse.rewrite(
new URL(
`${process.env.SERVER_URL}/.well-known` ||
`${process.env.SERVER_URL}${request.nextUrl.pathname}` ||
'http://localhost:5000/.well-known'
)
);
}
if (request.nextUrl.pathname.startsWith('/lnurlp')) {
return NextResponse.rewrite(
new URL(
`${process.env.SERVER_URL}/lnurlp` || 'http://localhost:5000/lnurlp'
`${process.env.SERVER_URL}${request.nextUrl.pathname}` ||
'http://localhost:5000/lnurlp'
)
);
}
Expand Down

0 comments on commit c00e591

Please sign in to comment.