0

I have a project hosted on Heroku using Mongolab for storing data (MongoDB). I need to create 2 different DB instances: one for prod, one for dev.

Any idea how can I do and how I can tell my code which one to use?

Thanks

zobi8225
  • 2,258
  • 4
  • 20
  • 20

1 Answers1

0

You should use a config variable (https://devcenter.heroku.com/articles/config-vars) to set the database url and then use the environment variable in your mongo initializer. Set one app to use the production url and a dev app to use the developer database url.

John Beynon
  • 37,398
  • 8
  • 88
  • 97
  • OK for the configuration environnement, But how can i generate a new DB URI from heroku ? Thanks, – zobi8225 Apr 08 '12 at 19:30
  • i have already read it, but they doesn't say how to install 2 URI on the same project. On irc , people says to me it is impossible. (sorry for my bad english..) – zobi8225 Apr 09 '12 at 11:11
  • you can't install duplicate addons of the same you would have two seperate apps on heroku with their own databases. – John Beynon Apr 09 '12 at 12:34