Search code examples
angularjsdatabasenodemon

Can't get nodemon to turn on for my old angular.js project


I have an angular.js project I was working on forever ago and I can't remember how to get nodemon to start currently I am getting the following error. Error: failed to connect to [127.0.0.1:27017]

I did see one question on here where they say to change the following line on the server.js

mongoose.connect('mongodb://localHost/myApp');

To this:

mongoose.connect('mongodb://127.0.0.1:27017/myApp');

Didn't help.


Solution

  • That error looks like you need to use mongod first then nodemon to start the server.

    So the command: mongod in a command prompt starts up your mongoDb instance. Then nodemon app (or whatever the node file name is will start the app)