2017-09-03T18:50:57.000000+00:00 app[api]: Build started by user
[me]
2017-09-03T18:51:28.776809+00:00 heroku[web.1]: State changed from
crashed to starting
2017-09-03T18:51:28.572116+00:00 app[api]: Deploy 20b0544e by user
[me]
2017-09-03T18:51:28.572116+00:00 app[api]: Release v22 created by
user [me]
2017-09-03T18:50:57.000000+00:00 app[api]: Build succeeded
2017-09-03T18:51:30.798246+00:00 heroku[web.1]: Starting process with
command `node index.js`
2017-09-03T18:51:34.045108+00:00 app[web.1]: Sun, 03 Sep 2017
18:51:34 GMT body-parser deprecated bodyParser: use individual
json/urlencoded middlewares at index.js:95:9
2017-09-03T18:51:34.047680+00:00 app[web.1]: Sun, 03 Sep 2017
18:51:34 GMT body-parser deprecated undefined extended: provide
extended option at node_modules/body-parser/index.js:105:29
2017-09-03T18:51:34.050039+00:00 app[web.1]: Sun, 03 Sep 2017
18:51:34 GMT express-session deprecated undefined resave option;
provide resave option at index.js:111:9
2017-09-03T18:51:34.050243+00:00 app[web.1]: memory, and will not
scale past a single process.
2017-09-03T18:51:34.142994+00:00 app[web.1]: listening on *:5000
2017-09-03T18:51:34.050242+00:00 app[web.1]: designed for a
production environment, as it will leak
2017-09-03T18:51:34.158304+00:00 app[web.1]: failed to connect to
server [localhost:27017] on first connect [MongoError: connect
ECONNREFUSED 127.0.0.1:27017]
2017-09-03T18:51:34.141487+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-09-03T18:51:34.050241+00:00 app[web.1]: Warning:
connect.session() MemoryStore is not
2017-09-03T18:51:34.050168+00:00 app[web.1]: Sun, 03 Sep 2017
18:51:34 GMT express-session deprecated undefined saveUninitialized
option; provide saveUninitialized option at index.js:111:9
2017-09-03T18:51:34.165093+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.
So I've been trying to deploy my Node.js application on Heroku for a few days now with little success.This indeed has caused some frustration since I need this app running on my website. Running the command heroku local web renders a working version of the application on port 5000.
2017-09-03T18:51:34.158304+00:00 app[web.1]: failed to connect to
server [localhost:27017] on first connect [MongoError: connect
ECONNREFUSED 127.0.0.1:27017]
I think this means that it is a problem with the MongoDB database I am using. I am using mLab as a database when the application is deployed in production. I have added the required connections for mLab in my code but it does not work. I really would appreciate it if someone could help me?
Also, do I need to deploy the modules installed with npm install to heroku for the application to work? I think it might be an issue with the packages installed when npm install is run. Could someone pin-point me to the issue?
Here is a link to the code, maybe download the files and take a look and test out the application locally and try deploying it to Heroku yourself if possible.