@wepublish/api
Version:
API core for we.publish.
39 lines • 1.87 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HealthController = void 0;
const tslib_1 = require("tslib");
const terminus_1 = require("@nestjs/terminus");
const common_1 = require("@nestjs/common");
const client_1 = require("@prisma/client");
const process = tslib_1.__importStar(require("process"));
let HealthController = exports.HealthController = class HealthController {
constructor(health, db, http, prisma) {
this.health = health;
this.db = db;
this.http = http;
this.prisma = prisma;
}
readiness() {
return this.health.check([
() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.db.pingCheck('database', this.prisma); }),
() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.http.pingCheck('editor', `${process.env.EDITOR_URL}`); }),
() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.http.pingCheck('website', `${process.env.WEBSITE_URL}`); }),
() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.http.pingCheck('media-server', `${process.env.MEDIA_SERVER_URL}/health`); })
]);
}
};
tslib_1.__decorate([
(0, common_1.Get)(),
(0, terminus_1.HealthCheck)(),
tslib_1.__metadata("design:type", Function),
tslib_1.__metadata("design:paramtypes", []),
tslib_1.__metadata("design:returntype", void 0)
], HealthController.prototype, "readiness", null);
exports.HealthController = HealthController = tslib_1.__decorate([
(0, common_1.Controller)('health'),
tslib_1.__metadata("design:paramtypes", [terminus_1.HealthCheckService,
terminus_1.PrismaHealthIndicator,
terminus_1.HttpHealthIndicator,
client_1.PrismaClient])
], HealthController);
//# sourceMappingURL=health.controller.js.map