mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 18:29:15 +03:00
12 lines
422 B
TypeScript
12 lines
422 B
TypeScript
import Route from '@ioc:Adonis/Core/Route';
|
|
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
|
|
import HealthCheck from '@ioc:Adonis/Core/HealthCheck';
|
|
|
|
Route.group(() => {
|
|
Route.get('/', async (ctx: HttpContextContract) => {
|
|
const report = await HealthCheck.getReport();
|
|
|
|
return report.healthy ? ctx.response.ok(report) : ctx.response.badRequest(report);
|
|
}).as('health');
|
|
}).prefix('health');
|