Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
I'm having issues connecting my MEAN stack app to mongo
I had a fully functioning app setup in Ubuntu with the MEAN stack, but when I sent it over to digitalocean, I’m having a strange connection issue. I can’t access the database, but it seems like maybe connecting to Mongo isn’t the problem so much as accessing the Node side of the application (everything in the api folder). My console error when trying to login, for example is this:
angular.js:12587 POST https://pottstownrumble.org/api/users/register 400 (Bad Request)
I’m able to log into the mongo shell and use mongoimport from the terminal, so I know I can connect. I had the connection url setup as mongodb://localhost:27017/mydbname, but changed it per the recommendations on the site from localhost to 127.0.0.1:27017/mydbname but that didn’t work either.