import type { HttpContext } from '@adonisjs/core/http' import { getMongoDb } from '#providers/mongodb_provider' export default class HealthController { async checklife({ response }: HttpContext) { return response.json({ status: 'OK' }) } async checkservice({ response }: HttpContext) { try { const db = getMongoDb() await db.command({ ping: 1 }) return response.json({ status: 'OK', version: '1.0.0' }) } catch { return response.status(503).json({ status: 'KO', version: '1.0.0' }) } } }