Error R10 with HapiJs + Heroku

I had a problem deploying and running a very simple HapiJs api on Heroku (Locally the app worked ok). The app crashed 60 seconds later server start.

Error message: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

The code below show my original server setup:

const server = new Hapi.Server();
server.connection({ port:process.env.PORT || 8000, host: ‘localhost’ });

But apparently, the host key must be removed from the connection object because overwrites the Heroku’s process.env.HOST variable.

To avoid problems, just fix the server.connection line to:

server.connection({port:process.env.PORT || 8000});


One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.