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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With