Is Meteor an option, if i need an additional REST

2020-05-19 07:12发布

I'm, going to write a web app, which should be CRUD accessible from both, the web and native mobile device apps. For the latter i'm definitely committed to a REST API. Is it possible to realize that with Meteor.com ? Would it be an option to use Meteor for just the web and a second REST interface to directly talk to the mongo? Since the meteor client listens for changes in the mongodb this should not cause conflicts, does it?

标签: rest meteor
3条回答
Evening l夕情丶
2楼-- · 2020-05-19 07:40

As of 2015, look at Gadi's answer for the Meteorpedia entry on REST APIs, and at krose's answer comparing REST API packages. Discussion for folding REST APIs into core is on Hackpad. This question is a duplicate of How to expose a RESTful service with Meteor, which has much better answers. -- Dan Dascalescu

Old answer (2012) below.


For adding RESTful methods on top of your data, look into the Collection API written for Meteor:

https://github.com/crazytoad/meteor-collectionapi

As for authentication for accessing the database, take a look at this project:

https://github.com/meteor/meteor/wiki/Getting-started-with-Auth

Both are definitely infantile in development, but you can create a RESTful API and integrate it with a mobile native client pretty easily.

查看更多
ら.Afraid
3楼-- · 2020-05-19 07:45

If you are planning to develop a production application, then Meteor is not an option right now. Its under constant change, and there are still many common features it has to support before its ready to use, which will be quite some time.

For your Question, Somebody has already asked and answered the question about support for file uploading in meteor(also contains HTTP handing related information).
How would one handle a file upload with Meteor?

查看更多
时光不老,我们不散
4楼-- · 2020-05-19 07:53

There are a lot of duplicates of this question. I did a full write-on on this in Meteorpedia which I believe covers all issues:

http://www.meteorpedia.com/read/REST_API

The post reviews all 6 options for creating REST interfaces, from highest level (e.g. smart packages that handle everything for you) to lowest level (e.g. writing your own connectHandler).

Additionally the post covers when using a REST interface is the right or wrong thing to do in Meteor, references Meteor REST testing tools, and explains common pitfalls like CORS security issues.

查看更多
登录 后发表回答