fix: listening on port undefined (#19)
If PORT is not defined in .env, console.log("Listening on port " + process.env.PORT) will display "Listening on port undefined".
This commit is contained in:
parent
7fab5e7fd0
commit
0a3fc7c3cd
@ -38,9 +38,11 @@ app.use(function(req, res, next) {
|
|||||||
.send('Not Found');
|
.send('Not Found');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const port = process.env.PORT || 3000;
|
||||||
|
|
||||||
//Start our server and tests!
|
//Start our server and tests!
|
||||||
app.listen(process.env.PORT || 3000, function () {
|
app.listen(port, function () {
|
||||||
console.log("Listening on port " + process.env.PORT);
|
console.log("Listening on port " + port);
|
||||||
if(process.env.NODE_ENV==='test') {
|
if(process.env.NODE_ENV==='test') {
|
||||||
console.log('Running Tests...');
|
console.log('Running Tests...');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user