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 · main
Menu

Theme