Skip to content

Commit dc5735a

Browse files
cubapthehabes
andauthored
We don't name our ports, this is all unneeded (#185)
Co-authored-by: Bryan Haberberger <bryan.j.haberberger@slu.edu>
1 parent b55cecd commit dc5735a

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

bin/rerum_v1.js

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff 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
1919
app.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
4141
server.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) {

0 commit comments

Comments
 (0)