Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

732
Vistas
Deploying on Heroku: Heroku gives me error 503 when app is deployed but app works on localhost

I'm trying to deploy a mern project for uni (already deplyoed react app on firebase) but my express/node.js rest api only works on localhost. I don't think the app even starts when deployed. Heroku gives me these errors:

Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command

and error 503 service unavailable in the network tab.


I tried heroku logs --tail and it said heroku[router]: at=error code=H10 desc="App crashed" method=GET ...


my Procfile:

web: node index.js

my package.json:

{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js"
  },
  "keywords": [
    "heroku"
  ],
  "engines": {
    "node": "16.x"
  },
  "author": "me",
  "license": "ISC",
  "dependencies": {
    "bcrypt": "^5.0.1",
    "express": "^4.17.1",
    "jsonwebtoken": "^8.5.1",
    "mongoose": "^6.0.14"
  }
}

PORT variable in index.js:

const PORT = process.env.PORT || 5000;
...
app.listen(PORT, () => console.log(`Server listening on port ${PORT}`));

I used Heroku CLI to deploy the app:

git init
git add .
git commit -am "initial commit"
heroku git:remote -a {project-name}
git push heroku master
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda