fix: add port fallback (#23)

Add fallback to port 3000, if PORT in env is not defined
main
Tajeddine Alaoui 2 years ago committed by GitHub
parent 38d1c3b9f6
commit b4dbd8ce86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,6 +28,6 @@ app.get("/api/hello", function (req, res) {
// 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);
});

Loading…
Cancel
Save