heroku Web process failed to bind to $ PORT within 60 seconds of launch

0

I'm trying to deploy an application made in angular in heroku, when doing the git push everything is fine, the problem is that when I try to enter the page it tells me that there has been an error application, in the logs I see the following error:

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

this is my package.json:

{
  "name": "re-mi",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "ng build --prod"
 },
  "private": true,
  "dependencies": {
     "@angular-devkit/build-angular": "~0.8.0",
     "@angular/cli": "~6.2.2",
     "@angular/compiler-cli": "^6.1.0",
     "@angular/animations": "^6.1.0",
     "@angular/common": "^6.1.0",
     "@angular/compiler": "^6.1.0",
     "@angular/core": "^6.1.0",
     "@angular/forms": "^6.1.0",
     "@angular/http": "^6.1.0",
     "@angular/platform-browser": "^6.1.0",
     "@angular/platform-browser-dynamic": "^6.1.0",
     "@angular/router": "^6.1.0",
     "angular-in-memory-web-api": "^0.6.1",
     "core-js": "^2.5.4",
     "rxjs": "~6.2.0",
     "zone.js": "~0.8.26",
     "typescript": "~2.9.2"
  },
  "devDependencies": {
  "@angular-devkit/build-angular": "~0.8.0",
  "@angular/cli": "~6.2.2",
  "@angular/compiler-cli": "^6.1.0",
  "@angular/language-service": "^6.1.0",
  "@types/jasmine": "~2.8.8",
  "@types/jasminewd2": "~2.0.3",
  "@types/node": "~8.9.4",
  "codelyzer": "~4.3.0",
  "jasmine-core": "~2.99.1",
  "jasmine-spec-reporter": "~4.2.1",
  "karma": "~3.0.0",
  "karma-chrome-launcher": "~2.2.0",
  "karma-coverage-istanbul-reporter": "~2.0.1",
  "karma-jasmine": "~1.1.2",
  "karma-jasmine-html-reporter": "^0.2.2",
  "protractor": "~5.4.0",
  "ts-node": "~7.0.0",
  "tslint": "~5.11.0",
  "typescript": "~2.9.2"
},
 "engines":{
  "node": "8.11.4",
  "npm": "6.4.1"
 }
}

and this is my server.js:

const express= require('express'),
 path= require('path');

const app =express();

app.use(express.static('./dist/re-mi'));

app.get('/*', (req,res)=>{
   res.sendFile(path.join(__dirname, '/dist/myapp/index.html'));
});

var port_number = server.listen(process.env.PORT || 3000);

app.listen(port_number);

Does anyone know what it can be?

    
asked by Eduard Damiam 14.11.2018 в 02:39
source

0 answers