user2009114
user2009114

Reputation: 371

How to serve HTTP requests over meteor

I am creating a live streaming application using meteor. Currently I have a need to create a live transcoding option, so I am trying to integrate this node.js module with our meteor application: https://github.com/mifi/hls-vod. However, the way it works is that you actually call the app.get(hls/) from your HTML5 video tag's src. I am wondering if there is a way to expect the call to this get using meteor. Since I can't integrate express with meteor I am having some trouble doing this. I am wondering if there is a way to have meteor receive HTTP requests and send back data as per the node module.

Upvotes: 5

Views: 3358

Answers (3)

Harry Adel
Harry Adel

Reputation: 1446

You directly use the underlying webapp as illustrated here or flow-router or picker for SSR routes.

Upvotes: 0

Arunoda Susiripala
Arunoda Susiripala

Reputation: 2534

Meteor Router is now deprecated for Iron Router.

See here for Server Side Routing with Iron Router

Upvotes: 4

Tarang
Tarang

Reputation: 75975

This post has been updated

To server http requests over meteor you need a router. I would recommend ironRouter. There was meteor 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');
    }
  });
});

Hopefully that should get the route working similar to the express router.

Upvotes: 5

Related Questions