fix: add port fallback (#23)

Add fallback to port 3000, if PORT in env is not defined
This commit is contained in:
Tajeddine Alaoui 2022-04-11 15:59:37 +00:00 committed by GitHub
parent 38d1c3b9f6
commit b4dbd8ce86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,6 @@ app.get("/api/hello", function (req, res) {
// listen for requests :) // listen for requests :)
var listener = app.listen(process.env.PORT, function () { var listener = app.listen(process.env.PORT || 3000, function () {
console.log('Your app is listening on port ' + listener.address().port); console.log('Your app is listening on port ' + listener.address().port);
}); });