import { Controller , Get } from '@nestjs/common' ; import type { HealthCheckResult } from '@nestjs/terminus' ; import { HealthCheck , HealthCheckService , TypeOrmHealthIndicator , } from '@nestjs/terminus' ; import { ServiceHealthIndicator } from './health-indicators/service.indicator' ; @ Controller ( 'health' ) export class HealthCheckerController { constructor ( private healthCheckService , private ormIndicator , private serviceIndicator ) { } @ Get ( ) @ HealthCheck ( ) async check ( ) { return this . healthCheckService . check ( [ ( ) => this . ormIndicator . pingCheck ( 'database' , { timeout : 1500 } ) , ( ) => this . serviceIndicator . isHealthy ( 'search-service-health' ) , ] ) ; } }