index/classes/HealthService.md
Reads GET /health. Public: no Authorization header is sent.
Example
const health = await new HealthService(httpClient).getHealth();
console.log(health.status, health.database?.status);
Extends
BaseService
base service
Constructors
Constructor
new HealthService(
http,debugMode?,jwtAuth?):HealthService
Parameters
| Parameter | Type |
|---|---|
http | HttpClient |
debugMode? | boolean |
jwtAuth? | JwtAuth |
Returns
HealthService
Inherited from
BaseService.constructor
debug mode jwt auth health service http client base
Methods
getHealth()
getHealth():
Promise<HealthCheckResponse>
The backend's health: overall status and the state of database, redis, mux, rabbitmq and
the GalaChain query / launchpad-contract probes.
A critical dependency being down answers HTTP 503, which throws a NetworkError
(statusCode 503, the backend's answer in body).
Returns
Promise<HealthCheckResponse>
Throws
NetworkError when the request fails or the body has no data
Since
9.0.0
get health check response network error status code
setJwtAuth()
setJwtAuth(
jwtAuth):void
Set the JWT authentication manager. Allows dynamic configuration of JWT auth after service creation.
Parameters
| Parameter | Type | Description |
|---|---|---|
jwtAuth | JwtAuth | JWT auth manager instance |
Returns
void
Inherited from
BaseService.setJwtAuth
set jwt auth base service