This commit is contained in:
seb
2026-07-31 18:25:42 +02:00
parent 1a05a5b7d6
commit 6074aa7304
33 changed files with 3041 additions and 470 deletions

View File

@@ -7,10 +7,37 @@ import { ensureConnection } from '../../db/store.js';
*/
export function register(app, basePath = '') {
/**
* @route GET /health
* @description Verifies the database client can establish a connection.
* @returns {Object} 200 - `{ ok: true }` when the database is reachable
* @returns {Object} 503 - `{ ok: false, error }` when the check fails
* @openapi
* /health:
* get:
* tags: [Health]
* summary: Database health check
* description: Verifies the database client can establish a connection.
* security: []
* x-markdown: health.md
* responses:
* 200:
* description: Database reachable
* content:
* application/json:
* schema:
* type: object
* properties:
* ok:
* type: boolean
* example: true
* 503:
* description: Database unreachable
* content:
* application/json:
* schema:
* type: object
* properties:
* ok:
* type: boolean
* example: false
* error:
* type: string
*/
app.get(`${basePath}/health`, async (_request, response) => {
try {