The project is being hosted in Heroku right now!
Today I'm going to write about how I set up the database for my app.
1. Login to Heroku dashboard: https://dashboard-next.heroku.com/apps
2. Click on your application
3. Under the Add-ons section, click on "Get more addons.."
4. Choose the service you need -- in my case I chose MongoHQ
You can use their services for free -- 512 mb for the MongoHQ Sandbox.
The only tedious part was verifying my account with a credit card.
Once it's all set up, I was able to access the database from my Heroku dashboard.
With this add on you can view the mongo documents you currently have stored and run queries too!
Additional notes for running a local version for testing:
When testing the application locally, it is useful to have a local instance of mongo running in my terminal.
Install mongo using Brew:
> brew install mongodb
** another side note: brew --> is Homebrew, a package manager for osx. This is what I used to install mongodb. Here's a link to download: http://brew.sh/
Run mongodb in the terminal:
> sudo mongod
Example of how to start up and query the database in the terminal:
> mongo
> use test
> show collections
> db.ephemerals.find()
> db.ephemerals.remove({})
That's it for today!
Bess
No comments:
Post a Comment