MongoDB / Meteor / Export MONGO_URL for deployed applications

I tried to export the settings.json file as described in the meteor.js documentation to connect my Meteor.js application to an external MongoHQ database:

{ "env": { "MONGO_URL" : "mongodb://xxx:xxxx@troup.mongohq.com:10037/xxx" } } 

with the command:

 mrt deploy myapp.meteor.com --settings settings.json 

It does not even work, My application continues to connect the local database that comes with Meteor.app! My enGO_URL env variable has not changed.

Is there any solution to export my MONGO_URL env variable to connect an external MongoDB database?

I saw that you can change it when using a hero or module, what about the standard deployment of meteor.com?

+6
javascript mongodb meteor
Feb 23 '14 at 16:34
source share
5 answers

You cannot use your own MONGO_URL with Meteor hosting hosting.

Weather hosting hosts email with Mailgun (if you use it) and provides mongodb for all applications deployed there.

You can change MAIL_URL , but you cannot use another mongodb.

You can try, although I'm not sure if it will work:

Put this in server side code somewhere

 process.env.MONGO_URL = '..'; 
+3
Feb 23 '14 at 16:50
source share

Create the lib folder in the server folder and write:

 Meteor.settings = { //your settings }; 

In accordance with the documentation, everything that is inside the folder named lib will be executed first of all, therefore, we guarantee that before that no code will be executed, preventing access errors to metrics that do not exist.

If you are already using the lib folder that you must specify to run before anything else is conflicting, check the docs about it.

Enjoy.

+2
Feb 19 '15 at 2:12
source share

The application configuration package (built-in meteor package) contains code for installing mongo_url. See my answer here https://stackoverflow.com/a/377618/

+1
May 08 '14 at 1:15
source share

Regarding frequently asked questions about Meteor.js informal chats, this cannot be done easily, it can be difficult.

So, I signed up for the module account using the MongoHQ database. He is working right now.

0
Feb 23 '14 at 17:45
source share

with settings.json file is not enough, you need to run with

  meteor --settings settings.json 

which you cannot perform with the deployment of meteor.com.

0
Feb 24 '14 at 5:26
source share



All Articles