From 061348f9d2108644db47f2f1e13853a4f9c93eeb Mon Sep 17 00:00:00 2001 From: Jason Haines Date: Sat, 16 Apr 2016 15:54:32 +1000 Subject: [PATCH] Use process.env.PORT when available Use process.env.PORT when available, otherwise default to 3001 --- example/socketsio-auth0-sample/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/example/socketsio-auth0-sample/index.js b/example/socketsio-auth0-sample/index.js index 3e27d6a..ba7ec2a 100644 --- a/example/socketsio-auth0-sample/index.js +++ b/example/socketsio-auth0-sample/index.js @@ -11,6 +11,7 @@ var env = { AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID, AUTH0_DOMAIN: process.env.AUTH0_DOMAIN, } +var port = process.env.PORT || 3001; app.set('views', __dirname + '/views') app.set('view engine', 'jade'); @@ -37,7 +38,7 @@ app.get('/', function (req, res) { ) }) -http.listen(3001, function(){ - console.log('listening on *:3001'); +http.listen(port, function(){ + console.log('listening on *:' + port); });