remove listen on port 3000

This commit is contained in:
Nikola Petrov 2023-07-30 13:39:05 +02:00
parent 511b39a65e
commit e13dcdcb8b

30
bin/www
View File

@ -12,8 +12,8 @@ var http = require('http');
* Get port from environment and store in Express. * Get port from environment and store in Express.
*/ */
var port = normalizePort(process.env.PORT || '3000'); // var port = normalizePort(process.env.PORT || '3000');
app.set('port', port); // app.set('port', port);
/** /**
* Create HTTP server. * Create HTTP server.
@ -25,7 +25,7 @@ var server = http.createServer(app);
* Listen on provided port, on all network interfaces. * Listen on provided port, on all network interfaces.
*/ */
server.listen(port); //server.listen(port);
server.on('error', onError); server.on('error', onError);
server.on('listening', onListening); server.on('listening', onListening);
@ -33,21 +33,21 @@ server.on('listening', onListening);
* Normalize a port into a number, string, or false. * Normalize a port into a number, string, or false.
*/ */
function normalizePort(val) { // function normalizePort(val) {
var port = parseInt(val, 10); // var port = parseInt(val, 10);
if (isNaN(port)) { // if (isNaN(port)) {
// named pipe // // named pipe
return val; // return val;
} // }
if (port >= 0) { // if (port >= 0) {
// port number // // port number
return port; // return port;
} // }
return false; // return false;
} // }
/** /**
* Event listener for HTTP server "error" event. * Event listener for HTTP server "error" event.