Using Node.JS, Express & MongoDB on Heroku
I was using Mongolian as the driver for Mongo so this is just a quicky post to scribble down the way
I went about it all (so I don’t need to go flicking through a load of docs next time)
I’ll do up a proper post on the whole thing at another stage
All fairly standard and ripped from the Heroku guides.
Next we need to add the MongoHQ addon to our Heroku app
This sets up a free database with MongoHQ and sets a heroku environment variable MONGOHQ_URL which points to the MongoDB instance.
Lastly, config Mongolian such that it will use a local MongoDB instance on your own machine, and the MongoHQ instance when on Heroku.
Fairly handy, but the last bit threw me a little as Mongolian returns the db handle when initialized with a connect string, but not if using default host and port.