import { TerminusEndpoint , TerminusOptionsFactory , DNSHealthIndicator , TerminusModuleOptions , } from '@nestjs/terminus' ; import { Injectable } from '@nestjs/common' ; @ Injectable ( ) export class TerminusOptionsService implements TerminusOptionsFactory { constructor ( private readonly dns ) { } createTerminusOptions ( ) { const healthEndpoint = { url : '/health' , healthIndicators : [ async ( ) => this . dns . pingCheck ( 'google' , 'https://google.com' ) , ] , } ; return { endpoints : [ healthEndpoint ] , } ; } }