Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

589
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda