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

137
Vistas
Heroku not finding endpoint with Express

So I created this local host app I am trying to deploy to Heroku with express and for some reason it works on localhost but not on the Heroku API, getting 502, if someone could help that would be awesome!

app.listen(process.env.PORT || 3000, () => console.log('listening at 3000'));
app.use(express.static('public'));
app.use(express.json({ limit: '5mb' }));
const database = new Datastore('database.db');
database.loadDatabase();
app.get('/api', (request, response) => {
database.find({}, (err, data) => {
if (err) {
  response.end();
  return;
}
response.json(data);
});
});

Wondering why this occurring to be honest, deployed many apps with the same setup and never had it happen like this. The package.json has all the proper NPM packages aswell

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