Skip to content

Commit

Permalink
fix: add default listen port for server (#235)
Browse files Browse the repository at this point in the history
* Add default listen port

* revise listener as requested

* Revised listener as requested

Added a space to console log
  • Loading branch information
ductilestudios authored Aug 29, 2021
1 parent 78ab54d commit 909d5f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ app.use(function(err, req, res, next) {
}
})

app.listen(process.env.PORT, function () {
console.log('Node.js listening ...');
//Listen on port set in environment variable or default to 3000
const listener = app.listen(process.env.PORT || 3000, function () {
console.log("Node.js listening on port " + listener.address().port);
});

0 comments on commit 909d5f1

Please sign in to comment.