Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Meteor an option, if i need an additional REST API?

Tags:

rest

meteor

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?

like image 480
bijan Avatar asked Jun 20 '12 17:06

bijan


People also ask

What can I use instead of REST API?

GraphQL is an alternative to Rest, which means you can replace almost any Rest API with it and still be able to do everything you were doing before. It's just implemented differently because it works as a query language instead.

Is REST API necessary?

One of the key advantages of REST APIs is that they provide a great deal of flexibility. Data is not tied to resources or methods, so REST can handle multiple types of calls, return different data formats and even change structurally with the correct implementation of hypermedia.

When should I use RESTful API?

The most common scenario of using REST APIs is to deliver static resource representations in XML or JSON. However, this architectural style allows users to download and run code in the form of Java applets or scripts (such as JavaScript).


1 Answers

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.

like image 159
isyi Avatar answered Sep 30 '22 03:09

isyi