在Meteor中使用流量路由器和铁路由器



我在Meteor应用程序中使用流路由器进行客户端路由。我需要在服务器端使用一个路由器来暴露一个webhook。所以,我插入了iron路由器,但iron路由器现在将html注入我的应用程序,抱怨我需要在应用程序中配置路由。我想它认为至少应该存在一条客户端路由,呃?我在服务器中实现了一个铁路由器路由,如下所示:

Router.map(function() {
  this.route('webhooks', {
  layoutTemplate: null,
  path: '/webhooks/:source',
  where: 'server'
})
.post(function() {
  // auth, stuff happens, etc //
  this.response.end('Thank you, come again!');
  });
});

有没有一些配置我可以添加到铁路由器,告诉它冷静下来?

您可能需要使用Picker而不是

https://github.com/meteorhacks/picker/

它被设计为流星的专用服务器端路由器。

FlowRouter也推荐https://kadira.io/academy/meteor-routing-guide/content/server-side-routing-rest

最新更新