UNPKG

@sustain/core

Version:

Sustain is a Framework that is barely used despedcies to make stable and sustainable apps

34 lines 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.bootstrap = void 0; const server_1 = require("./server"); const module_helper_1 = require("./utils/module.helper"); const http_request_helper_1 = require("./utils/http-request.helper"); class BootstrapFramework { constructor(app) { this.application = app; this.mainModuleMetaData = module_helper_1.getAllModuleMetaData(this.application); const { controllers, modules } = this.mainModuleMetaData; this.applicationRequests = http_request_helper_1.loadControllers(controllers); module_helper_1.executeOnServerStart(modules, this.applicationRequests); this.bootServer(this.applicationRequests, this.mainModuleMetaData); } bootServer(requests, mainModuleMetaData) { const { port, staticFolders = [], extensions = {}, middleswares = [] } = mainModuleMetaData; new server_1.SustainServer(requests, { port, staticFolders, extensions, middleswares, }); } } /** * Boostratp the Application * @param app */ function bootstrap(app) { new BootstrapFramework(app); } exports.bootstrap = bootstrap; //# sourceMappingURL=bootstrap.js.map