Meteor 流星路由器&x2B;幻影
我的Meteor应用程序使用Meteor路由器进行导航,并使用Spiderable插件获取搜索引擎索引的页面。Spiderable调用phantomjs来获取页面内容。这种方法适用于除主页外的大多数页面Meteor 流星路由器&x2B;幻影,meteor,phantomjs,Meteor,Phantomjs,我的Meteor应用程序使用Meteor路由器进行导航,并使用Spiderable插件获取搜索引擎索引的页面。Spiderable调用phantomjs来获取页面内容。这种方法适用于除主页外的大多数页面 '/': -> 'home' '/otherurl': -> 'otherpage' 我做了一些调试,发现spiderable.js中page.evaluate的回调在请求主页时总是返回false ... setInterval(function()
'/': ->
'home'
'/otherurl': ->
'otherpage'
我做了一些调试,发现spiderable.js中page.evaluate的回调在请求主页时总是返回false
...
setInterval(function() {
var ready = page.evaluate(function () {
if (typeof Meteor !== 'undefined' && typeof(Meteor.status) !== 'undefined' && Meteor.status().connected) {
Meteor.flush();
return Meteor._LivedataConnection._allSubscriptionsReady();
}
return false;
});
...
有什么建议吗?发布路由器的
home
功能的代码。最后我发现是以下代码导致了问题:Meteor.autosubscribe->Meteor.subscribe'items',Session.get('item_id')
因为启动会话时为空一直返回false,导致phantomjs挂断。您修复了此问题吗?如果是这样,请在下面发布答案:)在[meteor]标签中有太多问题的答案只存在于评论部分。