import { NextResponse } from "next/server";

import { fetchRenderServiceStatus } from "@/lib/render-service";

export const runtime = "nodejs";

/** Public read of the render-engine kill switch, so the studio can disable the
 *  "start render" button and show the unavailable message before the user clicks. */
export async function GET() {
  const status = await fetchRenderServiceStatus();
  return NextResponse.json(status, {
    headers: { "Cache-Control": "no-store" },
  });
}
