Spaces:
Sleeping
Sleeping
Caner Giden commited on
Create route.ts
Browse files12345678910111213141516171819202122232425import { NextResponse } from "next/server";
export async function GET() { const base = process.env.NEXT_PUBLIC_API_BASE || process.env.API_BASE || "";
if (!base) { return NextResponse.json({ error: "API_BASE missing" }, { status: 500 }); }
const url = `${base.replace(/\/$/, "")}/health`;
try { const r = await fetch(url, { cache: "no-store" }); const data = await r.json(); return NextResponse.json(data, { status: r.status }); } catch (e: any) { return NextResponse.json( { error: "core_unreachable", detail: String(e?.message || e) }, { status: 502 } ); }}app/api/core/health/route.tsAdded+25