Files
meteor/packages/ddp-server/server_convenience.js
2023-03-07 15:19:39 -03:00

30 lines
636 B
JavaScript
Executable File

if (process.env.DDP_DEFAULT_CONNECTION_URL) {
__meteor_runtime_config__.DDP_DEFAULT_CONNECTION_URL =
process.env.DDP_DEFAULT_CONNECTION_URL;
}
Meteor.server = new Server();
Meteor.refresh = async function (notification) {
await DDPServer._InvalidationCrossbar.fire(notification);
};
// Proxy the public methods of Meteor.server so they can
// be called directly on Meteor.
_.each(
[
'publish',
'isAsyncCall',
'methods',
'call',
'callAsync',
'apply',
'applyAsync',
'onConnection',
'onMessage',
],
function(name) {
Meteor[name] = _.bind(Meteor.server[name], Meteor.server);
}
);