import { sqlPublic } from "@/db"; export const dynamic = "force-dynamic"; export async function GET() { try { const [r] = await sqlPublic`SELECT count(*)::int AS n FROM public_papers WHERE status = 'published'`; return Response.json({ ok: true, papers: r.n, time: new Date().toISOString() }, { headers: { "Cache-Control": "no-store" } }); } catch (e) { return Response.json({ ok: false, error: (e as Error).message }, { status: 503, headers: { "Cache-Control": "no-store" } }); } }