1 | "use strict";
|
2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3 | return new (P || (P = Promise))(function (resolve, reject) {
|
4 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
7 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8 | });
|
9 | };
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | const fs_1 = require("fs");
|
12 | const ServerBootstrap_1 = require("./lib/ServerBootstrap");
|
13 | function boostrap() {
|
14 | return __awaiter(this, void 0, void 0, function* () {
|
15 | require.extensions[".html"] = (module, filename) => {
|
16 | module.exports = fs_1.readFileSync(filename).toString();
|
17 | };
|
18 | const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 5000;
|
19 | const env = process.env.NODE_ENV === "production" ? "production" : "development";
|
20 | const server = new ServerBootstrap_1.default({
|
21 | port,
|
22 | rootPath: process.cwd(),
|
23 | env,
|
24 | });
|
25 | return server.start();
|
26 | });
|
27 | }
|
28 | exports.default = boostrap;
|