fix(web-admin): add Next.js proxy route for /api/app/version/check

Fixes QR code not showing on my-org and register pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-09 07:13:29 -07:00
parent afc1ae6fbe
commit 4a00baa0e3
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
import { NextRequest, NextResponse } from 'next/server';
function getApiBaseUrl(): string {
return process.env.API_BASE_URL || 'http://localhost:8000';
}
export async function GET(request: NextRequest) {
const url = `${getApiBaseUrl()}/api/app/version/check${request.nextUrl.search}`;
try {
const res = await fetch(url, { cache: 'no-store' });
const data = await res.json();
return NextResponse.json(data, { status: res.status });
} catch {
return NextResponse.json({ error: 'version service unavailable' }, { status: 503 });
}
}