import { NextResponse } from "next/server";

const CALENDAR_URL = process.env.CALENDAR_SERVICE_URL || "http://127.0.0.1:8084";

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