A
A
Alexander Wolf2015-06-01 04:20:38
JavaScript
Alexander Wolf, 2015-06-01 04:20:38

How to implement HTTP api on meteor?

Hey! How to implement API on meteor?
I have a program that periodically makes a post request to a site at a specific address and sends the necessary information.
How to catch it on a meteor? After all, an empty application is first opened there, and then all the logic is pulled through JS.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2015-06-01
@mannaro

If Iron router is installed, then:

//https://github.com/iron-meteor/iron-router/blob/devel/Guide.md#server-routing
Router.route('/item', function () {
  var req = this.request;
  var res = this.response;
  res.end('hello from the server\n');
}, {where: 'server'});

or alternatively, here's a good one:
https://github.com/meteorhacks/picker

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question