UNPKG

@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.

43 lines 1.22 kB
import { CLI } from './cli/index.js'; import { Desktop } from './desktop/index.js'; import { Server } from './server/server.js'; export class Platforms { server; cli; desktop; constructor(config) { const { server, cli, desktop } = config; if (server) { this.server = new Server(server); } if (cli) { this.cli = new CLI(cli); } if (desktop) { this.desktop = new Desktop(desktop); } } async registerEntrypoints(entryPoints) { if (this.server && entryPoints.rest) { await this.server.registerEntrypoints(entryPoints.rest); } if (this.cli && entryPoints.cli) { await this.cli.registerEntrypoints(entryPoints.cli); } if (this.desktop && entryPoints.ipc) { await this.desktop.registerEntrypoints(entryPoints.ipc); } } async start(options) { if (this.server) { await this.server.start(options); } if (this.cli) { await this.cli.start(); } if (this.desktop) { await this.desktop.start(); } } } //# sourceMappingURL=platforms.js.map