如何通过meteor来提供HTTP请求

我正在使用meteor创build一个实时stream媒体应用程序。 目前我有一个需要创build一个实时转码选项,所以我正在试图将这个node.js模块与我们的meteor应用程序: https : //github.com/mifi/hls-vod 。 然而,它的工作方式是,你实际上从你的HTML5video标签的src调用app.get(hls /)。 我想知道是否有一种方法可以期待使用meteor的电话。 由于我不能整合meteor,所以我在这方面遇到一些麻烦。 我想知道是否有一个方法来让meteor接收HTTP请求,并根据节点模块发回数据。

这篇文章已经更新

要通过meteor来服务器http请求,你需要一个路由器。 我会推荐IronRouter。 有meteor路由器,但汤姆科尔曼也build立ironRouter。

你可以使用这样的东西:

Router.map(function () { this.route('serverFile', { path: '/pathonserver', action: function () { console.log(this.params); //Contains params this.response.writeHead(200, {'Content-Type': 'text/html'}); this.response.end('hello from server'); } }); }); 

希望能得到类似于express路由器的路由。

meteor路由器现在已经弃用了铁路路由器 。

使用铁路路由器在这里看到服务器端路由