Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get meteor.com apps to use external mongo db

Tags:

mongodb

meteor

On my dev machine I can set the environment variable MONGO_URL to define the mongo instance I want my app to use. How to I set the mongo instance that my app on meteor.com will use?

I'm looking for something I could put in my settings.json, or some other way to set MONGO_URL for my meteor app at myapp.meteor.com

like image 877
cwohlman Avatar asked Nov 10 '22 08:11

cwohlman


1 Answers

It looks like meteor doesn't support this. I'm going to use a modified version of the meteor application-configuration package to put my mongo_url var in a settings.json

See https://github.com/meteor/meteor/blob/devel/packages/application-configuration/config.js#L74

packages: {
  'mongo-livedata': {
     url: process.env.MONGO_URL,
     oplog: process.env.MONGO_OPLOG_URL
  }
}

Update:

The link above is now broken, here's the updated link: https://github.com/meteor/meteor/blob/c0ea40230e146c6ecd27d1031c50cf2542b60eb7/packages/mongo/remote_collection_driver.js#L29

See also https://github.com/meteor/meteor/blob/37f32305912e31faa004e1c69a9905c2e363c275/packages/meteor/server_environment.js

like image 173
cwohlman Avatar answered Nov 15 '22 07:11

cwohlman