Skip to content

Commit

Permalink
Make sure not to assume app.address() exists since it depends on the …
Browse files Browse the repository at this point in the history
…version of express and connect and node.
  • Loading branch information
richtera committed Jul 21, 2012
1 parent 7ae690e commit dbe0272
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,17 @@ if (!module.parent) {
exports.boot(false, function (app) {

if (app) {
app.listen(port, function () {
var out = app.listen(port, function () {
console.log("Calipso version: ".green + app.about.version);
console.log("Calipso configured for: ".green + (global.process.env.NODE_ENV || 'development') + " environment.".green);
console.log("Calipso server listening on port: ".green + app.address().port);
if (app.address)
console.log("Calipso server listening on port: ".green + app.address().port);
else
console.log("Calipso server listening on port: ".green + port);
});
process.nextTick(function () {
if (out && out.address && out.address().port !== port)
console.log("Calipso server listening on port: ".red + out.address().port);
});
} else {
console.log("\r\nCalipso terminated ...\r\n".grey);
Expand Down

0 comments on commit dbe0272

Please sign in to comment.