How to serve HTTP requests through a meteorite

I am creating a streaming streaming application using a meteorite. Currently, I need to create a real-time transcoding option, so I'm trying to integrate this node.js module with our meteor application: https://github.com/mifi/hls-vod . However, how this works, you actually call app.get (hls /) from your HTML5 src video tag. I am wondering if there is a way to expect a meteor to get a call for this. Since I cannot integrate the express with a meteorite, I am having some problems with this. I am wondering if there is a way to receive meteorite HTTP requests and send back the data according to the node module.

+5
source share
2 answers

This post has been updated.

For HTTP server requests through a meteorite, you need a router. I would recommend ironRouter. There was a meteorite router, but Tom Coleman also built IronRouter.

You can use something like this:

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');
    }
  });
});

I hope this should lead to the fact that the route will work similarly to an express router.

+5
source

Meteor Router is now deprecated for Iron Router .

See here for server-side routing using Iron Router

+4
source

All Articles