perf: 增加健康检查探针 /health/liveliness 和 /health/readiness

v2-dev-buy
xiaojunnuo 2025-08-29 10:07:17 +08:00
parent fd0e1da4a2
commit 44019e1042
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
import {Controller, Get, Provide} from '@midwayjs/core';
import {BaseController, Constants} from '@certd/lib-server';
/**
*/
@Provide()
@Controller('/health')
export class HealthController extends BaseController {
@Get('/liveliness', { summary: Constants.per.guest })
async liveliness(): Promise<any> {
return this.ok('ok')
}
@Get('/readiness', { summary: Constants.per.guest })
async readiness(): Promise<any> {
return this.ok('ok')
}
}