Skip to content

Commit 58fcf8e

Browse files
Added variable port capabilities
1 parent 18c6f44 commit 58fcf8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var express = require('express');
22
var app = express();
33

4+
app.set('port', (process.env.PORT || 5000));
45
app.use(express.static(__dirname + '/public'));
56

67
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
@@ -18,8 +19,8 @@ app.get('/api/:date', function(req,res) {
1819
}
1920
});
2021

21-
app.listen(3000, function() {
22-
console.log("Listening on port 3000");
22+
app.listen(app.get('port'), function() {
23+
console.log("Listening on port " + app.get('port'));
2324
});
2425

2526

0 commit comments

Comments
 (0)