I have a Sinatra and Rails 3 applications. Applications were created independently and are hosted in 2 separate Heroku instances. So I need a share one MongoHQ database to both applications. How can I do it? Any idea?
Thanks.
I have a Sinatra and Rails 3 applications. Applications were created independently and are hosted in 2 separate Heroku instances. So I need a share one MongoHQ database to both applications. How can I do it? Any idea?
Thanks.
It's really easy.
In the application that has the MongoHQ database look at the output of
heroku config
- you're looking for the entryMONGOHQ_URL
.All you need do is on the other application set a similar config variable to the same value as displayed from the the first application and then use it as ENV['MONGOHQ_URL'] in your second application.