@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.
27 lines • 810 B
JavaScript
import { container } from '../../../third-party/tsyringe.js';
export 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) {
container.registerSingleton(provider, provider);
}
}
}
registerServices() {
if (this.config.services && this.config.services.length > 0) {
for (const service of this.config.services) {
container.registerSingleton(service, service);
}
}
}
}
//# sourceMappingURL=domain.js.map