Setu-TS
    Preparing search index...

    Function HealthPlugin

    • Creates a health plugin.

      Parameters

      Returns IPlugin

      A plugin that registers an IHealthService under 'health'

      If details is not a boolean or readiness membership is invalid

      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.

      0.2.0