fix and update
This commit is contained in:
15
apps/frontend/app/downloads/windows/route.ts
Normal file
15
apps/frontend/app/downloads/windows/route.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
|
||||
function resolveApiBase(request: NextRequest) {
|
||||
const internal = process.env.INTERNAL_API_URL?.replace(/\/$/, '');
|
||||
if (internal) return internal;
|
||||
const origin = request.nextUrl.origin;
|
||||
return `${origin}/idp-api`;
|
||||
}
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
const target = `${resolveApiBase(request)}/releases/download/windows`;
|
||||
return NextResponse.redirect(target, 302);
|
||||
}
|
||||
Reference in New Issue
Block a user