0
我想調用方法,在這一個,我做一個http獲取,如果結果是好的我返回它並跟蹤它在我的mongodb基地,如果它返回一個錯誤,我想跟蹤它也。流星異步方法
不幸的是,它不工作!我閱讀了stackoverflow上的帖子,但只有老問題。
你有什麼解決方案嗎?
的客戶:
Meteor.call('get',function(err, response) {
console.log(err+" ee"+response);
});
服務器:
var header = 'xxxxxxxx';
Meteor.startup(function() {
Meteor.methods({
get : function(){
console.log("call");
var url = 'http://xxxxxxxxxx';
this.unblock();
Meteor.http.get(url, function(err,res){
if(!err){
//tracking
return res;
}else{
//tracking
return err;
}
});
}
});
});
添加我不需要更改我的客戶電話? – Lombric
你不需要改變你的客戶電話。 – user3374348