import type { APIRoute } from 'astro'; import { dbHealthy } from '../../lib/views'; export const prerender = false; // GET /api/health — Docker HEALTHCHECK / Dokploy. 503 if the view-counter DB is unavailable. export const GET: APIRoute = () => { const db = dbHealthy(); return Response.json( { status: db ? 'ok' : 'degraded', db }, { status: db ? 200 : 503, headers: { 'Cache-Control': 'no-store' } }, ); };