Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #44 from lornajane/listen

wait for the app to actually listen before calling address()
  • Loading branch information...
commit 8084419f6e7517157b71f6a10ff052dea84b258e 2 parents bc0a9b5 + e5e1ecb
@mansilladev mansilladev authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 app.js
View
6 app.js
@@ -722,6 +722,8 @@ app.get('/:api([^\.]+)', function(req, res) {
if (!module.parent) {
var port = process.env.PORT || config.port;
- app.listen(port);
- console.log("Express server listening on port %d", app.address().port);
+ var l = app.listen(port);
+ l.on('listening', function(err) {
+ console.log("Express server listening on port %d", app.address().port);
+ });
}
Please sign in to comment.
Something went wrong with that request. Please try again.