• 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.

    Parameters

    • app: Express

      A Express app.

    • ServiceHealthEndpointOptions: ServiceHealthEndpointOptions = {}

      The configuration object for service health check endpoints

    • Optional logger: Logger

      A logger object to use for output generated inside the middleware.

    Returns {
        serviceHealthData: HealthData;
    }

Generated using TypeDoc