0

I am trying a test to move all my development to Nitrous.io IDE, but with limited space in my Nitrous box I want to permanently host my Mongo databases at MongoHQ.com. Currently each day I need to set my MONGO_URL by running:

export MONGO_URL='mongodb://<user>:<pass>@paulo.mongohq.com:12345/<db>'

If I fire up another console or logout of Nitrous my MONGO_URL needs to set again.

How can I set the development MONGO_URL for good per meteor app? I cannot find a config file anywhere.

Hubert OG
  • 19,314
  • 7
  • 45
  • 73
benstr
  • 652
  • 4
  • 16

2 Answers2

4

Nitrous support helped me find a quick solution. Just wanted to answer it here for others with the same issue.

Open ~/.bash_profile and enter your DB information.

example:

export MONGO_URL='mongodb://jimmy:criket@paulo.mongohq.com:12345/mynitrobox'

Next in the console run source ~/.bash_profile to load the settings.

This sets the DB for your entire node.js box, not individual meteor apps, so you may want to structure your Mongo collections accordingly with subcollections.

benstr
  • 652
  • 4
  • 16
  • 1
    Not sure how Nitrous works but usually you would use a bash script that exports MONGO_URL and then runs meteor (probably using forever). Then you run the bash script every time you need to start your server. – alanning Oct 17 '13 at 16:59
  • 1
    Hi, and thanks for the guidance. Spotted a typo though, it should be "Open ~/.bash_profile", not bash-profile. – tmatuschek Dec 10 '13 at 21:25
1

you can do this in one line like so:

MONGO_URL='mongodb://<user>:<pass>@paulo.mongohq.com:12345/<db>' meteor

I don't know much about Nitrous.io but in AWS EC2 I have an upstart job that runs this for me when the server starts.

I gist'd my approach a while back, I've since changed it a bit but this still works:

https://gist.github.com/davidworkman9/6466734

I don't know that this will help you in Nitrous.io though, good luck!

Dave
  • 2,506
  • 2
  • 20
  • 27
  • Thanks Dave. I did not even consider it being a Nitrous issue. They must have a script that runs whenever `meteor` is ran. – benstr Oct 16 '13 at 18:12