Skip to content

Commit da49c79

Browse files
committed
Allow to provide port number through env.PORT
1 parent db80901 commit da49c79

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/server/main.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ app.use(
2424
);
2525

2626
// Listen for incoming HTTP requests
27-
const listener = app.listen(() => {
27+
const listener = app.listen(process.env.PORT || undefined, () => {
2828
let host = listener.address().address;
2929
if (host === '::') {
3030
host = 'localhost';
3131
}
3232
const port = listener.address().port;
33-
/* eslint-disable no-console */
33+
// eslint-disable-next-line no-console
3434
console.log('Listening at http://%s%s', host, port === 80 ? '' : ':' + port);
35-
/* eslint-enable no-console */
3635
});

0 commit comments

Comments
 (0)