Node.js – Web process failed to bind to $PORT within 60 seconds of launch node.js

herokunode.js

I am deploying a node.js app on heroku. The code looks like this:

var port = process.env.PORT || 8080;
var ip_addr = "127.0.0.1";
server.listen(port, ip_addr, function() {
    console.log("%s listening at %s ", server.name, server.url);
});

I don't know why I get Web process failed to bind to $PORT within 60 seconds of launch node.js
error. Any help would be appreciated.

Best Answer

I would imagine it has something to do with being explicit about the IP address. Try just doing server.listen(port, function() { ... ?

Related Topic