Class: HealthService
Gala Launchpad SDK 9.0.0-rc.5 / index / HealthService
Class: HealthService
Defined in: packages/launchpad-sdk/dist/services/HealthService.d.ts:20
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
Constructors
Constructor
new HealthService(
http,debugMode?,jwtAuth?):HealthService
Defined in: packages/launchpad-sdk/dist/services/BaseService.d.ts:43
Parameters
http
HttpClient
debugMode?
boolean
jwtAuth?
JwtAuth
Returns
HealthService
Inherited from
BaseService.constructor
Methods
getHealth()
getHealth():
Promise<HealthCheckResponse>
Defined in: packages/launchpad-sdk/dist/services/HealthService.d.ts:31
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
setJwtAuth()
setJwtAuth(
jwtAuth):void
Defined in: packages/launchpad-sdk/dist/services/BaseService.d.ts:50
Set the JWT authentication manager. Allows dynamic configuration of JWT auth after service creation.
Parameters
jwtAuth
JwtAuth
JWT auth manager instance
Returns
void
Inherited from
BaseService.setJwtAuth