@duongtrungnguyen/nestro
Version:
Service registry for Nest JS
74 lines • 2.95 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __decorateClass = (decorators, target, key, kind) => {
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
for (var i = decorators.length - 1, decorator; i >= 0; i--)
if (decorator = decorators[i])
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
if (kind && result) __defProp(target, key, result);
return result;
};
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
var registry_controller_exports = {};
__export(registry_controller_exports, {
RegistryController: () => RegistryController
});
module.exports = __toCommonJS(registry_controller_exports);
var import_common = require("@nestjs/common");
var import_services = require("../services");
let RegistryController = class {
constructor(registryService) {
this.registryService = registryService;
}
async register(service) {
return await this.registryService.register(service);
}
async deregister(service) {
return await this.registryService.deregister(service);
}
async heartbeat(service) {
return await this.registryService.heartbeat(service);
}
async getServices() {
return await this.registryService.getServices();
}
};
__decorateClass([
(0, import_common.Post)("register"),
__decorateParam(0, (0, import_common.Body)())
], RegistryController.prototype, "register", 1);
__decorateClass([
(0, import_common.Delete)("deregister"),
__decorateParam(0, (0, import_common.Body)())
], RegistryController.prototype, "deregister", 1);
__decorateClass([
(0, import_common.Post)("heartbeat"),
__decorateParam(0, (0, import_common.Body)())
], RegistryController.prototype, "heartbeat", 1);
__decorateClass([
(0, import_common.Get)("services")
], RegistryController.prototype, "getServices", 1);
RegistryController = __decorateClass([
(0, import_common.Controller)("nestro"),
__decorateParam(0, (0, import_common.Inject)(import_services.RegistryService))
], RegistryController);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
RegistryController
});
//# sourceMappingURL=registry.controller.js.map