feat: add /api/health endpoint for deployment health checks
Build & Push Docker Image / test (push) Successful in 15s
Build & Push Docker Image / build-and-push (push) Successful in 49s

This commit is contained in:
Giancarmine Salucci
2026-07-08 00:58:06 +02:00
parent 9f906d509d
commit 92683e2047
+18
View File
@@ -0,0 +1,18 @@
import { json } from '@sveltejs/kit';
import { getJob } from '$lib/server/db.js';
export async function GET() {
try {
// Real DB query: check if we can fetch a job.
// If no jobs exist, this succeeds with null (schema exists and is reachable).
// If schema doesn't exist or DB is down, this throws.
getJob('no-such-job');
return json({ status: 'ok' }, { status: 200 });
} catch (err) {
return json(
{ status: 'error', message: String(err) },
{ status: 500 }
);
}
}