Skip to content

Commit

Permalink
Merge pull request #1127 from benatkin/template-port-from-env
Browse files Browse the repository at this point in the history
get port from env in template (fix for #1118)
  • Loading branch information
tj committed May 7, 2012
2 parents 8235af4 + 5f65c36 commit 9da3e9c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/express
Expand Up @@ -181,6 +181,7 @@ var app = [
, 'var app = express();'
, ''
, 'app.configure(function(){'
, ' app.set(\'port\', process.env.PORT || 3000);'
, ' app.set(\'views\', __dirname + \'/views\');'
, ' app.set(\'view engine\', \':TEMPLATE\');'
, ' app.use(express.favicon());'
Expand All @@ -197,9 +198,9 @@ var app = [
, ''
, 'app.get(\'/\', routes.index);'
, ''
, 'http.createServer(app).listen(3000);'
, ''
, 'console.log("Express server listening on port 3000");'
, 'http.createServer(app).listen(app.get(\'port\'), function() {'
, ' console.log("Express server listening on port " + app.get(\'port\'));'
, '});'
, ''
].join(eol);

Expand Down

0 comments on commit 9da3e9c

Please sign in to comment.