import { healthChecks } from "#start/health.js" import { middleware } from "#start/kernel.js" import type { HttpContext } from "@adonisjs/core/http" import router from "@adonisjs/core/services/router" class Controller { public async handle(context: HttpContext): Promise { const report = await healthChecks.run() if (report.isHealthy) { return context.response.ok(report) } return context.response.serviceUnavailable(report) } } router.get("/health", [Controller]).use(middleware.appKeySecurity())