From 5a053e5875aa3a6deb7ac947a031fe604da79250 Mon Sep 17 00:00:00 2001 From: LouisLam Date: Fri, 30 Jul 2021 11:33:44 +0800 Subject: [PATCH] parse the port to int --- server/server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/server.js b/server/server.js index 48f120a76..3789540db 100644 --- a/server/server.js +++ b/server/server.js @@ -20,7 +20,7 @@ const { login } = require("./auth"); const passwordHash = require("./password-hash"); const version = require("../package.json").version; const hostname = args.host || "0.0.0.0" -const port = process.env.PORT || args.port || 3001 +const port = parseInt(process.env.PORT || args.port || 3001); console.info("Version: " + version) @@ -98,7 +98,9 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); totalClient--; }); + // *************************** // Public API + // *************************** socket.on("loginByToken", async (token, callback) => { @@ -191,7 +193,9 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); } }); + // *************************** // Auth Only API + // *************************** socket.on("add", async (monitor, callback) => { try {