import { Controller , Get } from '@nestjs/common' ; import { HealthCheck , HealthCheckResult , HealthCheckService , HealthIndicatorResult , HttpHealthIndicator , TypeOrmHealthIndicator } from '@nestjs/terminus' ; import { Public } from '../../common' ; /**
 * https://docs.nestjs.com/recipes/terminus
 */ @ Controller ( ) export class HealthController { constructor ( private health , private http , private db ) { } @ Public ( ) @ Get ( 'health' ) @ HealthCheck ( ) public async check ( ) { return this . health . check ( [ async ( ) : Promise < HealthIndicatorResult > => this . http . pingCheck ( 'dns' , 'https://1.1.1.1' ) , async ( ) : Promise < HealthIndicatorResult > => this . db . pingCheck ( 'database' ) , ] ) ; } }