🐛 fix bundle listen
This commit is contained in:
parent
c687dedaa5
commit
ea8c47d64e
@ -9,10 +9,9 @@ import express from "express";
|
|||||||
import { Config } from "../../util/dist";
|
import { Config } from "../../util/dist";
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const server = http.createServer();
|
const server = http.createServer(app);
|
||||||
const port = Number(process.env.PORT) || 8080;
|
const port = Number(process.env.PORT) || 8080;
|
||||||
const production = true;
|
const production = true;
|
||||||
server.on("request", app);
|
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const api = new APIServer({ server, port, production, app });
|
const api = new APIServer({ server, port, production, app });
|
||||||
|
@ -60,6 +60,11 @@ if (cluster.isMaster && !process.env.masterStarted) {
|
|||||||
console.log(`[Database] started`);
|
console.log(`[Database] started`);
|
||||||
console.log(`[Process] running with pid: ${process.pid}`);
|
console.log(`[Process] running with pid: ${process.pid}`);
|
||||||
|
|
||||||
|
if (cores === 1) {
|
||||||
|
require("./Server.js");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Fork workers.
|
// Fork workers.
|
||||||
for (let i = 0; i < cores; i++) {
|
for (let i = 0; i < cores; i++) {
|
||||||
cluster.fork();
|
cluster.fork();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user