Skip to content

Commit

Permalink
try to remove the socket file before connecting
Browse files Browse the repository at this point in the history
  • Loading branch information
switzer committed Apr 10, 2014
1 parent 73551d0 commit 3ed1374
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1021,10 +1021,12 @@ if (!module.parent) {
if (typeof config.socket != "undefined") {
var args = [config.socket];
console.log("Express server starting on UNIX socket %s", args[0]);
fs.unlink(config.socket, function () {
app.listen.apply(app, args);
});
} else {
var args = [process.env.PORT || config.port, config.address];
console.log("Express server starting on %s:%d", args[1], args[0]);
app.listen.apply(app, args);
}

app.listen.apply(app, args);
}

0 comments on commit 3ed1374

Please sign in to comment.