logger/src/modules/health/interface/http-controllers/health.http.controller.ts

23 lines
453 B
TypeScript

import { Controller, Get } from '@nestjs/common';
import {
HealthCheckService,
HttpHealthIndicator,
HealthCheck,
} from '@nestjs/terminus';
@Controller('health')
export class HealthController {
constructor(
private health: HealthCheckService,
private http: HttpHealthIndicator,
) {}
@Get()
@HealthCheck()
check() {
return this.health.check([
() => this.http.pingCheck('google.fr', 'https://google.fr'),
]);
}
}