Skip to content

Connectum API Reference / @connectum/healthcheck / Healthcheck

Function: Healthcheck()

Healthcheck(options?): ProtocolRegistration

Defined in: Healthcheck.ts:83

Create healthcheck protocol registration

Returns a ProtocolRegistration directly (not { protocol, manager }). Pass to createServer({ protocols: [...] }). Use the singleton healthcheckManager export to control health status.

Parameters

options?

HealthcheckOptions = {}

Healthcheck configuration options

Returns

ProtocolRegistration

ProtocolRegistration for createServer

Example

typescript
import { createServer } from '@connectum/core';
import { Healthcheck, healthcheckManager, ServingStatus } from '@connectum/healthcheck';

const server = createServer({
  services: [myRoutes],
  protocols: [Healthcheck({ httpEnabled: true })],
});

server.on('ready', () => {
  healthcheckManager.update(ServingStatus.SERVING);
});

await server.start();