import { env } from '../../config/env.js'; import { notFound } from '../http.js'; import { statusSnapshot } from '../services/status-service.js'; /** * Machine-readable twin of the public status page (M19). * * `/api/health` says whether the process is alive, which is what a load * balancer asks. This says what state the service is in, which is what a person * — or an uptime monitor with a dashboard — asks. */ export function registerStatusRoutes(router) { router.get( '/api/status', async ({ context }) => { if (!env.web.publicStatus) throw notFound('La page de statut est désactivée.'); return statusSnapshot(context); }, { public: true }, ); }