summary refs log tree commit diff
path: root/src/start.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-24 20:47:06 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-24 20:47:06 +0200
commit8f87546aeb5c14539601ab25c0e07630a5e5043a (patch)
treec9d5ca2d0c307096d5a4e44768c66b4d8cf05ec4 /src/start.ts
parentMerge pull request #147 from DiegoMagdaleno/master (diff)
downloadserver-8f87546aeb5c14539601ab25c0e07630a5e5043a.tar.xz
:sparkles: use new config
Diffstat (limited to '')
-rw-r--r--src/start.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/start.ts b/src/start.ts

index 8d5c33ce..1f069c51 100644 --- a/src/start.ts +++ b/src/start.ts
@@ -7,7 +7,7 @@ config(); import { FosscordServer } from "./Server"; import cluster from "cluster"; import os from "os"; -const cores = os.cpus().length; +const cores = Number(process.env.threads) || os.cpus().length; if (cluster.isMaster && process.env.production == "true") { console.log(`Primary ${process.pid} is running`); @@ -22,8 +22,7 @@ if (cluster.isMaster && process.env.production == "true") { cluster.fork(); }); } else { - var port = Number(process.env.PORT); - if (isNaN(port)) port = 3001; + var port = Number(process.env.PORT) || 3001; const server = new FosscordServer({ port }); server.start().catch(console.error);