Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

587
Views
Getting "Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch" on Nodejs

I'm developing an API on NodeJS using express and I'm getting this error while trying to deploy it to Heroku:

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

I am using the process.env.PORT variable, as I found here on SO, but it is still not working. Here's the index.js code:

var express = require('express');
var app = express();
var bodyParser = require("body-parser");
app.use(bodyParser.json());
var router = require("./router");
app.use('/viatges', router);

app.listen(3000 || process.env.PORT,function(){
    console.log("up and running on port "+process.env.PORT);
});

Do you have any idea of what could be causing this issue?

On the heroku logs i see this line

2017-04-01T11:44:07.091181+00:00 app[web.1]: up and running on port 27583

so I assume the PORT enviornment variable is correctly set up...

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Nevermind, i just fixed it. I changed the order of the operands in the OR, I assume javascript just went with the first as it was defined.

It now looks like this:

app.listen(process.env.PORT || 3000 ,function(){
    console.log("up and running on port "+process.env.PORT);
});
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!