SPB Git
430 B · 7 lines typescript
1import { sqlPublic } from "@/db";2export const dynamic = "force-dynamic";3export async function GET() {4  try { const [r] = await sqlPublic<{ n: number }[]>`SELECT count(*)::int AS n FROM public_tools`; return Response.json({ ok: true, tools: r.n, time: new Date().toISOString() }, { headers: { "cache-control": "no-store" } }); }5  catch { return Response.json({ ok: false, error: "database unavailable" }, { status: 503 }); }6}7
Files · 26d3764ea3f3414ef122de45da4ad93a2165fb05
Menu

Theme