parent
a82a78c938
commit
59e5e529c6
@ -8,6 +8,6 @@ export function middleware(request: NextRequest) {
|
||||
if (!process.env.API_HOST) {
|
||||
throw new Error("env variable \"API_HOST\" is not set")
|
||||
}
|
||||
const url = new URL(process.env.API_HOST + request.nextUrl.pathname + request.nextUrl.search)
|
||||
const url = new URL(process.env.API_HOST + request.nextUrl.pathname.replace(/^\/api/, '') + request.nextUrl.search)
|
||||
return NextResponse.rewrite(url, { request })
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user