I'm teaching myself how to use MongoDB and Node.Js, specifically I'm trying to setup Deployd (the open source api-building framework) which is built on top of mongo & node, and host it on Heroku. I'm following this tutorial:
http://www.icapps.com/open-source-alternative-for-parse/
My problem occurs when trying to connect to http://localhost:3000/
it throws up the error:
GET /dashboard/ Error: failed to connect to [127.0.0.1:27017]
at null.<anonymous> (/Users/kimi/Documents/Web/deployd/deployd-demo/node_modules/deployd/node_modules/mongodb/lib/mongodb/connection/server.js:383:73)
at EventEmitter.emit (events.js:95:17)
at null.<anonymous> (/Users/kimi/Documents/Web/deployd/deployd-demo/node_modules/deployd/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:93:15)
at EventEmitter.emit (events.js:98:17)
at Socket.<anonymous> (/Users/kimi/Documents/Web/deployd/deployd-demo/node_modules/deployd/node_modules/mongodb/lib/mongodb/connection/connection.js:385:10)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:441:14
at process._tickDomainCallback (node.js:459:13)
I know this has something to do with mongo not connecting to the server correctly. But am at a loss at how to fix this. Does anyone have any suggestions for this newbie?
Thank you so much!
/////////// ANSWER! (stackoverflow won't let me post an answer for another 8 hours), but basically it appears that the mongo directory was created in the wrong place. but running:
sudo mkdir -p /data/db
and changing the permissions to:
sudo chmod 0755 /data/db
sudo chown mongod:mongod /data/db
it appears to work. yay! i used this stackoverflow answer as a reference:
mongodb Mongod complains that there is no /data/db folder
thank you so much @Niall for all your help!!!