Setup a health endpoint for an express application. The serviceHealthOptions object will contain the options to configure the health endpoint route as required, and if not specified, will default to /health.
The function will return a serviceHealthData handle, that can be used to set the current health data of the service (i.e. a key-value object as defined by the service). If not set, this will default to an empty object (i.e. {})
When an HTTP GET request is made to the health endpoint of a service, it will return a 200 response code along with contents set to the serviceHealthData handle by the service.
Setup a health endpoint for an express application. The
serviceHealthOptions
object will contain the options to configure the health endpoint route as required, and if not specified, will default to/health
. The function will return aserviceHealthData
handle, that can be used to set the current health data of the service (i.e. a key-value object as defined by the service). If not set, this will default to an empty object (i.e.{}
) When an HTTP GET request is made to the health endpoint of a service, it will return a 200 response code along with contents set to theserviceHealthData
handle by the service.