node.js - Failure when deploy to Heroku -


i trying deploy application heroku.

the build succeeded there application error.

here build log:

2017-08-19t10:52:32.433135+00:00 heroku[web.1]: state changed crashed  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 command  `node app.js`  2017-08-19t10:52:38.533264+00:00 app[web.1]: (node:4) deprecationwarning:  `open()` deprecated in mongoose >= 4.11.0, use `openuri()` instead, or set  `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  no longer available in next major release 3.x mongodb 3.6  allow auth against users in admin db , no longer allow  multiple credentials on socket. please authenticate using  mongoclient.connect auth credentials.  2017-08-19t10:52:38.879889+00:00 app[web.1]: 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 can point me in right direction. thanks.

found solution me here: heroku + node.js error (web process failed bind $port within 60 seconds of launch)

in case app crashed because hard setting port, instead of using port heroku dinamicaly sets, can accessed 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);  }); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -