import { NextResponse } from "next/server";

const STATUS_URL = process.env.STATUS_SERVICE_URL || "http://127.0.0.1:8086";

export async function GET() {
  try {
    const res = await fetch(`${STATUS_URL}/health`);
    const data = await res.json();
    return NextResponse.json(data);
  } catch {
    return NextResponse.json({ error: "Status service unavailable" }, { status: 502 });
  }
}
