Skip to content

Commit fe021ad

Browse files
committed
feat: update health check stub to have handlers for livness and readiness
1 parent c679e2f commit fe021ad

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stubs/make/health/controller.stub

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ import { healthChecks } from '#start/health'
99
import type { HttpContext } from '@adonisjs/core/http'
1010

1111
export default class {{ controllerName }} {
12-
async handle({ response }: HttpContext) {
13-
const report = await healthChecks.run()
12+
async live({ response }: HttpContext) {
13+
return response.ok()
14+
}
1415

16+
async ready({ response }: HttpContext) {
17+
const report = await healthChecks.run()
1518
if (report.isHealthy) {
1619
return response.ok(report)
1720
}

0 commit comments

Comments
 (0)