2

I have a Meteor app that currently polls another app for updates. I would like to stop the inefficient polling and have the other app just POST data to the meteor app when it's ready. How can I receive POST data in my meteor app?

2 Answers 2

2

You can use the built in webapp package to receive and respond HTTP requests on the server side. It works without any additional packages (such as iron router, flow router etc.).

Sign up to request clarification or add additional context in comments.

Comments

2

If you are using Iron Router, you can setup a server route to handle the request:

if (Meteor.isServer) {
  Router.map(function () {
    this.route('serverRoute', {
      where: 'server',
      path: '/server',
      action: function() {
        if (this.request.method === 'POST')
          this.response.end("handling post request");
      }
    });
  });
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.