UNPKG

@plokkke/nest-health-registry

Version:

A NestJS module providing a health check registry using @nestjs/terminus

58 lines 2.56 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HealthController = void 0; const common_1 = require("@nestjs/common"); const terminus_1 = require("@nestjs/terminus"); const HealthRegistryService_1 = require("./HealthRegistryService"); let HealthController = class HealthController { service; constructor(service) { this.service = service; } checkStartup() { return null; } async checkLiveness() { return this.service.checkLiveness(); } async checkReadiness() { return this.service.checkReadiness(); } }; exports.HealthController = HealthController; __decorate([ (0, common_1.Get)('/startup'), (0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT), (0, terminus_1.HealthCheck)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], HealthController.prototype, "checkStartup", null); __decorate([ (0, common_1.Get)('/liveness'), (0, terminus_1.HealthCheck)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], HealthController.prototype, "checkLiveness", null); __decorate([ (0, common_1.Get)('/readiness'), (0, terminus_1.HealthCheck)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], HealthController.prototype, "checkReadiness", null); exports.HealthController = HealthController = __decorate([ (0, common_1.Controller)({ path: '/health', version: common_1.VERSION_NEUTRAL }), __metadata("design:paramtypes", [HealthRegistryService_1.HealthRegistryService]) ], HealthController); //# sourceMappingURL=HealthController.js.map