2015-09-22 50 views
0

我想用流星發佈複合兩個執行一些連接操作。我有兩個使用ddp服務連接的流星應用程序。在第一臺服務器上,我已經發布了用於發佈複合的代碼。但是如何從server2調用它。發佈複合兩個ddp連接服務器在流星

我的server1代碼。

Meteor.publishComposite('board', function (userid) { 
    console.log('here') 
    return { 
    find: function() { 
     console.log(23456) 
     return Meteor.users.find(userid); 
    }, 
    children: [{ 
     find: function (user) { 
     return Apartment.find(user.lineup); 
    }] 
    } 
}); 

打電話給哪裏Meteor.subscribe('boards');

如何從另一個使用ddp服務連接的應用程序使用它。提前致謝。

回答

1
+0

感謝:

var otherServer = DDP.connect(url); otherServer.subscribe(); // subscribe to collections otherServer.call(); // call meteor methods 

的方法完整列表。這是工作。 –