14

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?

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
bijan
  • 1,675
  • 18
  • 30
  • Do maybe the meteor devs have some details on that? I know they're hanging around here :) – bijan Jun 21 '12 at 16:17
  • Duplicate of [How to expose a RESTful service with Meteor](http://stackoverflow.com/questions/10150538/how-to-expose-a-restful-web-service-using-meteor), which has much better answers. – Dan Dascalescu Apr 28 '15 at 22:21

3 Answers3

15

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.

Community
  • 1
  • 1
isyi
  • 1,282
  • 1
  • 11
  • 11
4

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.

gadicc
  • 1,431
  • 15
  • 16
  • Whilst this may theoretically answer the question, [it would be preferable](https://meta.stackoverflow.com/questions/8259) to include the essential parts of the answer here, and provide the link for reference. In your case, it would be better if the 6 options were included in this post! – Léo Lam Jul 28 '14 at 08:25
0

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?

Community
  • 1
  • 1
Nachiket
  • 6,021
  • 6
  • 41
  • 47