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.

47 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Platforms = void 0; const cli_1 = require("./cli"); const desktop_1 = require("./desktop"); const server_1 = require("./server/server"); class Platforms { server; cli; desktop; constructor(config) { const { server, cli, desktop } = config; if (server) { this.server = new server_1.Server(server); } if (cli) { this.cli = new cli_1.CLI(cli); } if (desktop) { this.desktop = new desktop_1.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(); } } } exports.Platforms = Platforms; //# sourceMappingURL=platforms.js.map