SPB Git

Repository Public MIT

route.ts 785 B 18 lines typescript

1import { getCourse } from "@/lib/content";23export const dynamic = "force-dynamic";45/**6 * Liveness and readiness of the public site: the course loads — from the studio database when it is the7 * source, which also proves the database opens and its migrations are in place — and validates.8 * No internal detail is exposed here; operators read /api/health/details (token) or `pnpm studio health`.9 */10export async function GET() {11  try {12    const course = await getCourse();13    return Response.json({ status: "ok", mode: course.mode, sessions: course.counts.sessions, published: course.counts.published }, { headers: { "Cache-Control": "no-store" } });14  } catch {15    return Response.json({ status: "error" }, { status: 503, headers: { "Cache-Control": "no-store" } });16  }17}18
Files main
Menu

Theme