0
votes

My Heroku app seems to always crash after deployment.

The errors on Heroku logs are:

2015-07-21T13:28:08.173666+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=calm-hamlet- 5165.herokuapp.com request_id=93f36ad5-f9c2-42b2-a662-9f730d1228ab fwd="197.253.32.226" dyno= connect= service= status=503 bytes=

and

2015-07-21T13:29:28.127452+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/v1/sessions" host=calm-hamlet-5165.herokuapp.com request_id=69711e3a-913e-45ed- b4bf-82baaa164edf fwd="197.253.32.226" dyno= connect= service= status=503 bytes=

What could be causing this error?

1

1 Answers

0
votes

Probably is a port definition problem. Heroku will assign a port on which the application will run, regardless of you defining it. You should replace that hardcoded port for something like this.

    var port = process.env.PORT || 5000;

Hopefully that fix the problem