import { NextResponse } from "next/server";

const BACKUP_URL = process.env.BACKUP_SERVICE_URL || "http://127.0.0.1:8083";

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