2
1
mirror of https://github.com/Thream/socketio-jwt.git synced 2024-07-21 09:38:31 +02:00

Use process.env.PORT when available

Use process.env.PORT when available, otherwise default to 3001
This commit is contained in:
Jason Haines 2016-04-16 15:54:32 +10:00
parent 8ebeaba025
commit 061348f9d2

View File

@ -11,6 +11,7 @@ var env = {
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID, AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
AUTH0_DOMAIN: process.env.AUTH0_DOMAIN, AUTH0_DOMAIN: process.env.AUTH0_DOMAIN,
} }
var port = process.env.PORT || 3001;
app.set('views', __dirname + '/views') app.set('views', __dirname + '/views')
app.set('view engine', 'jade'); app.set('view engine', 'jade');
@ -37,7 +38,7 @@ app.get('/', function (req, res) {
) )
}) })
http.listen(3001, function(){ http.listen(port, function(){
console.log('listening on *:3001'); console.log('listening on *:' + port);
}); });