UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

30 lines 1.29 kB
import Controller from './controller.js'; import { NONE } from '../types/permissions.js'; import { createResponseSchema } from '../openapi/util/create-response-schema.js'; export class HealthCheckController extends Controller { constructor(config, { openApiService }) { super(config); this.route({ method: 'get', path: '', handler: this.getHealth, permission: NONE, middleware: [ openApiService.validPath({ tags: ['Operational'], operationId: 'getHealth', summary: 'Get instance operational status', description: 'This operation returns information about whether this Unleash instance is healthy and ready to serve requests or not. Typically used by your deployment orchestrator (e.g. Kubernetes, Docker Swarm, Mesos, et al.).', responses: { 200: createResponseSchema('healthCheckSchema'), 500: createResponseSchema('healthCheckSchema'), }, }), ], }); } async getHealth(_, res) { res.status(200).json({ health: 'GOOD' }); } } //# sourceMappingURL=health-check.js.map