Lucas Breitembach
Lucas Breitembach

Reputation: 1683

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

**HEROKU Logs --tail***dasdasdsdsa HEROKU and HAPIJS Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launchHEROKU and HAPIJS Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch HEROKU and HAPIJS Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launchHEROKU and HAPIJS Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launchHEROKU and HAPIJS Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launchHEROKU and HAPIJS Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch Starting process with command npm start

    2019-02-10T22:55:41.713305+00:00 heroku[web.1]: State changed from starting to crashed
    2019-02-10T22:55:41.565831+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
    2019-02-10T22:55:41.565970+00:00 heroku[web.1]: Stopping process with SIGKILL
    2019-02-10T22:55:41.695141+00:00 heroku[web.1]: Process exited with status 137

My server Start.

'use strict';

// Create a server with a host and port
const server=Hapi.server({
    host:'0.0.0.0',
    port: process.env.PORT | 8000
});

// Add the route
server.route({
  method:'GET',
  path:'/hello',
  handler:function(request,h) {

      return'hello world';
  }
});

// Start the server
const start =  async function() {

  try {
      await server.start();
  }
  catch (err) {
      console.log(err);
      process.exit(1);
  }

  console.log('Server running at:', server.info.uri);
};

start();

package JSON

{
  "name": "Fish",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "yarn test",
    "dev": "NODE_ENV=development nodemon server.js",
    "start": "node server.js",
    "deploy": "git add . && git commit -m 'deploy automatitly' && git push heroku master"
  },

  "license": "ISC",
  "dependencies": {
    "boom": "^7.3.0",
    "hapi": "^17.8.4",
    "hapi-server-session": "^4.3.1",
    "hapi-swagger": "^9.3.1",
    "inert": "^5.1.2",
    "joi": "^14.3.1",
    "mongoose": "^5.4.11",
    "rest-hapi": "^1.3.3",
    "vision": "^5.4.4"
  },
  "devDependencies": {
    "nodemon": "^1.18.10"
  },
  "engines": {
    "node": "~8.11.4",
    "npm": "5.6.0"
  }
}

Upvotes: 3

Views: 453

Answers (1)

Lindsaydoodle
Lindsaydoodle

Reputation: 1

Create a Procfile (no extension) and in it write app: node "your js for start".js without the quotes Then use localhost instead of 0.0.0.0 And in the settings https://dashboard.heroku.com/apps/"your app"/resources
there are sliders enter image description here

enter image description here

It worked for me and hopefully for you too. good luck)

Upvotes: 0

Related Questions