Port timeout deploying Loopback app to Heroku Port timeout deploying Loopback app to Heroku heroku heroku

Port timeout deploying Loopback app to Heroku


You can force Heroku to use provided port by modifying the code as provided in the documentation. If you can't relate to api docs, don't worry it's because javascript is flexible.

app.start = function () {  // start the web server  var port = process.env.PORT || 3000;  app.use(loopback.static(path.resolve(__dirname, '../client')));  app.use(loopback.static(path.resolve(__dirname, '../.tmp')));  return app.listen(port, function () {    app.emit('started');    console.log('Web server listening at: %s', app.get('url'));  });};


I had thesame problem. I solved it by adding an environment variable HOST=0.0.0.0 in my Heroku app.

Heroku app environment variables