From eb96242b90bfed70dc3690c84064cb5f00cd4203 Mon Sep 17 00:00:00 2001 From: Ferrari <shiyung@gmail.com> Date: Thu, 3 Oct 2013 15:29:59 +0800 Subject: [PATCH] fix port binding error when deploy to heroku --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 10f7cff57a..947264c73b 100755 --- a/server.js +++ b/server.js @@ -50,7 +50,7 @@ require('./config/express')(app, passport); require('./config/routes')(app, passport, auth); //Start the app by listening on <port> -var port = config.port; +var port = process.env.PORT || config.port; app.listen(port); console.log('Express app started on port ' + port); @@ -58,4 +58,4 @@ console.log('Express app started on port ' + port); logger.init(app, passport, mongoose); //expose app -exports = module.exports = app; \ No newline at end of file +exports = module.exports = app;