Optionaloptions: HealthPluginOptions
Plugin configuration options
A plugin that registers an IHealthService under 'health'
app.register(HealthPlugin());
// Or with custom options
app.register(HealthPlugin({
endpoints: {
health: '/health',
live: '/live',
ready: '/ready',
},
indicators: [
createHttpIndicator('external-api', { url: 'https://api.example.com/health' }),
(services) => createDatabaseIndicator(services),
],
}));
indicators accepts an instance or a RegistryFactory
((services: IServiceRegistry) => IHealthIndicator). A factory is resolved at
onInit — the first phase at which the registry holds every capability — and,
because HealthPlugin registers at priority 100, before the database and every
other ordinary capability plugin. Instance indicators keep their register() timing.
Creates a health plugin.