Add no-ops for Meteor.publish, methods, and onConnection if no webapp

This commit is contained in:
Ronen Babayoff
2015-01-22 02:07:56 -04:00
committed by David Glasser
parent 074087be8a
commit eeb95efaed

7
packages/ddp/server_convenience.js Normal file → Executable file
View File

@@ -24,6 +24,13 @@ if (Package.webapp) {
Meteor.server = null;
Meteor.refresh = function (notification) {
};
// Make these empty/no-ops too, so that non-webapp apps can still
// depend on/use packages that use those functions.
_.each(['publish', 'methods', 'onConnection'],
function (name) {
Meteor[name] = function () { };
});
}
// Meteor.server used to be called Meteor.default_server. Provide