Muralidhar Reddy
Muralidhar Reddy

Reputation: 11

how to consume meteor API call

I need to write a Java web application to call a function Meteor APP. One way is through API call. Are there any other means to call Meteor function from 3rd party application.

Thanks Murali

Upvotes: 0

Views: 162

Answers (2)

Werner Bihl
Werner Bihl

Reputation: 306

There are quite a few packages at https://atmospherejs.com/?q=rest that can expose your Meteor methods as RESTful API points which your Java app can consume.

Upvotes: 0

jordanwillis
jordanwillis

Reputation: 10705

It all depends on what your requirements are, how your Meteor app is structured, and what sort of integration you desire.

If you are wanting your Java web application to be able to natively call Meteor methods or subscribe to publications, then you will have to use a Java DDP Client to do this. Fortunately, there is at least one documented Java DDP client that you can use for this (and probably many others out there is you search). For your reference, here is a compiled list of DDP clients for other languages/technologies.

If on the other hand you don't want to interface with you meteor app using DDP, then you could always implement a REST API in your meteor app. There are several packages available to do this, but I would highly recommend the simple:rest package.

This package automatically creates a REST API for all your existing publications and methods without any extra code (just simply add the package to your meteor app). If you do need to configure or modify the REST API, the package also provides several options that you can use in your publication or meteor method definition. The package also enforces all your app's security rules and authorization.

For example, if your app had a publication called openTasks, then the corresponding REST endpoint would be.

GET /publications/openTasks

Upvotes: 1

Related Questions