File tree Expand file tree Collapse file tree 1 file changed +2
-24
lines changed
Expand file tree Collapse file tree 1 file changed +2
-24
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ dotenv.config()
1515 * Get port from environment and store in Express.
1616 */
1717
18- var port = normalizePort ( process . env . PORT ?? ' 3001' )
18+ var port = process . env . PORT ?? 3001
1919app . set ( 'port' , port )
2020
2121/**
@@ -40,26 +40,6 @@ server.keepAliveTimeout = 8 * 1000 //8 seconds
4040// Ensure the headersTimeout is set higher than the keepAliveTimeout due to this nodejs regression bug: https://github.com/nodejs/node/issues/27363
4141server . headersTimeout = 8.5 * 1000 //8 seconds
4242
43- /**
44- * Normalize a port into a number, string, or false.
45- */
46-
47- function normalizePort ( val ) {
48- const portCheck = parseInt ( val , 10 )
49-
50- if ( isNaN ( portCheck ) ) {
51- // named pipe
52- return val
53- }
54-
55- if ( portCheck >= 0 ) {
56- // port number
57- return portCheck
58- }
59-
60- return false
61- }
62-
6343/**
6444 * Event listener for HTTP server "error" event.
6545 */
@@ -69,9 +49,7 @@ function onError(error) {
6949 throw error
7050 }
7151
72- var bind = typeof port === 'string'
73- ? 'Pipe ' + port
74- : 'Port ' + port
52+ var bind = `Port ${ port } `
7553
7654 // handle specific listen errors with friendly messages
7755 switch ( error . code ) {
You can’t perform that action at this time.
0 commit comments