1 | import { readFileSync } from "fs";
|
2 | import ServerBootstrap from "./lib/ServerBootstrap";
|
3 | export default async function boostrap() {
|
4 | require.extensions[".html"] = (module, filename) => {
|
5 | module.exports = readFileSync(filename).toString();
|
6 | };
|
7 | const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 5000;
|
8 | const env = process.env.NODE_ENV === "production" ? "production" : "development";
|
9 | const server = new ServerBootstrap({
|
10 | port,
|
11 | rootPath: process.cwd(),
|
12 | env,
|
13 | });
|
14 | return server.start();
|
15 | }
|