Version 0.2.1 Change the Port of the server
This commit is contained in:
parent
87dd1779a4
commit
95d868b411
@ -4,6 +4,7 @@ const { LogType } = require("./sub-log");
|
|||||||
const log = require("./sub-log");
|
const log = require("./sub-log");
|
||||||
const auth = require("./sub-auth");
|
const auth = require("./sub-auth");
|
||||||
const cookieParser = require("cookie-parser");
|
const cookieParser = require("cookie-parser");
|
||||||
|
const { error } = require("console");
|
||||||
const wlog = new LogType("Web")
|
const wlog = new LogType("Web")
|
||||||
|
|
||||||
module.exports.WebServer = class {
|
module.exports.WebServer = class {
|
||||||
@ -69,7 +70,7 @@ function init() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
server.listen(port);
|
server.listen(port);
|
||||||
server.on('error', onError);
|
server.on('error', onError(error, port));
|
||||||
server.on('listening', () => {
|
server.on('listening', () => {
|
||||||
|
|
||||||
let addr = server.address();
|
let addr = server.address();
|
||||||
@ -104,7 +105,7 @@ function normalizePort(val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event listener for HTTP server "error" event
|
// Event listener for HTTP server "error" event
|
||||||
function onError(error) {
|
function onError(error, port) {
|
||||||
if (error.syscall !== 'listen') {
|
if (error.syscall !== 'listen') {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user