File

lib/health-indicators/dns/dns.health.ts

Description

The DNSHealthIndicator contains health indicators which are used for health checks related to HTTP requests and DNS

Extends

HealthIndicator

Example

Index

Methods

Constructor

constructor(httpService: HttpService)

Initializes the health indicator

Parameters :
Name Type Optional Description
httpService HttpService No

The HttpService provided by Nest

Methods

Async pingCheck
pingCheck(key: string, url: string, options: AxiosRequestConfig)

Checks if the given url respons in the given timeout and returns a result object corresponding to the result

Parameters :
Name Type Optional Default value Description
key string No

The key which will be used for the result object

url string No

The url which should be request

options AxiosRequestConfig No {}

Optional axios options

Example :
dnsHealthIndicator.pingCheck(&#39;google&#39;, &#39;<a href="https://google.com&#39;">https://google.com&#39;</a>, { timeout: 800 })
Protected getStatus
getStatus(key: string, isHealthy: boolean, data?: literal type)

Generates the health indicator result object

Parameters :
Name Type Optional Description
key string No

The key which will be used as key for the result object

isHealthy boolean No

Whether the health indicator is healthy

data literal type Yes

Additional data which will get appended to the result object

result-matching ""

    No results matching ""