mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Improve data flow from deployConfig to mongo-livedata.
(Still ought to be better refactored though.)
This commit is contained in:
@@ -26,6 +26,10 @@ Package.on_use(function (api) {
|
||||
// Allow us to detect 'autopublish', and publish collections if it's loaded.
|
||||
api.use('autopublish', 'server', {weak: true});
|
||||
|
||||
// RemoteCollectionDriver gets its deployConfig from something that is (for
|
||||
// questionable reasons) initialized by the webapp package.
|
||||
api.use('webapp', 'server', {weak: true});
|
||||
|
||||
api.export('MongoLivedataTest', 'server', {testOnly: true});
|
||||
|
||||
api.add_files('mongo_driver.js', 'server');
|
||||
|
||||
@@ -23,9 +23,10 @@ _.extend(RemoteCollectionDriver.prototype, {
|
||||
// you're only trying to receive data from a remote DDP server.)
|
||||
getRemoteCollectionDriver = _.once(function () {
|
||||
// XXX kind of hacky
|
||||
var mongoUrl = (typeof __meteor_bootstrap__ !== 'undefined' &&
|
||||
Meteor._get(__meteor_bootstrap__.deployConfig,
|
||||
'packages', 'mongo-livedata', 'url'));
|
||||
var mongoUrl = (
|
||||
typeof __meteor_bootstrap__ !== 'undefined' &&
|
||||
Meteor._get(__meteor_bootstrap__,
|
||||
'deployConfig', 'packages', 'mongo-livedata', 'url'));
|
||||
// XXX bad error since it could also be set directly in METEOR_DEPLOY_CONFIG
|
||||
if (! mongoUrl)
|
||||
throw new Error("MONGO_URL must be set in environment");
|
||||
|
||||
@@ -183,7 +183,9 @@ var runWebAppServer = function () {
|
||||
throw new Error("Unsupported format for client assets: " +
|
||||
JSON.stringify(clientJson.format));
|
||||
|
||||
// XXX change all this config to something more reasonable
|
||||
// XXX change all this config to something more reasonable.
|
||||
// and move it out of webapp into a different package so you don't
|
||||
// have weird things like mongo-livedata weak-dep'ing on webapp
|
||||
var deployConfig =
|
||||
process.env.METEOR_DEPLOY_CONFIG
|
||||
? JSON.parse(process.env.METEOR_DEPLOY_CONFIG) : {};
|
||||
|
||||
Reference in New Issue
Block a user