@sentzunhat/zacatl
Version:
A modular, high-performance TypeScript microservice framework for Node.js, featuring layered architecture, dependency injection, and robust validation for building scalable APIs and distributed systems.
31 lines • 954 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Domain = void 0;
const tsyringe_1 = require("../../../third-party/tsyringe.js");
class Domain {
config;
constructor(config) {
this.config = config;
this.register();
}
register() {
this.registerProviders();
this.registerServices();
}
registerProviders() {
if (this.config.providers && this.config.providers.length > 0) {
for (const provider of this.config.providers) {
tsyringe_1.container.registerSingleton(provider, provider);
}
}
}
registerServices() {
if (this.config.services && this.config.services.length > 0) {
for (const service of this.config.services) {
tsyringe_1.container.registerSingleton(service, service);
}
}
}
}
exports.Domain = Domain;
//# sourceMappingURL=domain.js.map