diff --git a/it0-web-admin/src/app/api/app/version/check/route.ts b/it0-web-admin/src/app/api/app/version/check/route.ts new file mode 100644 index 0000000..16e4e2b --- /dev/null +++ b/it0-web-admin/src/app/api/app/version/check/route.ts @@ -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 }); + } +}