0

I am trying to deploy my application to Heroku.

The build succeeded but there is an application error.

Here is the build log:

2017-08-19T10:52:32.433135+00:00 heroku[web.1]: State changed from crashed to 
starting

2017-08-19T10:52:20.000000+00:00 app[api]: Build succeeded                                                              

2017-08-19T10:52:34.561890+00:00 heroku[web.1]: Starting process with command 
`node app.js`

2017-08-19T10:52:38.533264+00:00 app[web.1]: (node:4) DeprecationWarning: 
`open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set 
the `useMongoClient` option if using `connect()` or `createConnection()`. See 
http://mongoosejs.com/docs/connections.html#use-mongo-client

2017-08-19T10:52:38.577755+00:00 app[web.1]: Db.prototype.authenticate method 
will no longer be available in the next major release 3.x as MongoDB 3.6 will 
only allow auth against users in the admin db and will no longer allow 
multiple credentials on a socket. Please authenticate using 
MongoClient.connect with auth credentials.

2017-08-19T10:52:38.879889+00:00 app[web.1]: the data has been seeded

2017-08-19T10:53:38.120507+00:00 heroku[router]: at=error code=H10 desc="App 
crashed" method=GET path="/" host=murmuring-garden-83350.herokuapp.com 
request_id=dae4f901-83d5-442c-bca0-396508c8661e fwd="83.185.242.212" dyno= 
connect= service= status=503 bytes= protocol=https

Really hope someone can point me in the right direction. Thanks.

1 Answers1

0

Found solution for me here: Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch)

In my case my app crashed because I was hard setting the PORT, instead of using the port that heroku dinamicaly sets, which can be accessed with process.env.PORT

 app.listen(process.env.PORT || 3000, function(){
 console.log("Express server listening on port %d in %s mode", 
 this.address().port, app.settings.env);
 });