UNPKG

570 BPlain TextView Raw
1import { readFileSync } from "fs";
2import ServerBootstrap from "./lib/ServerBootstrap";
3export 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}