Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you make a REST API and upload files in Meteor [closed]

Tags:

rest

meteor

What is about a REST API? Is there already a way to define some routes and logic for the API on the server? I think this is nowadays a must-have feature.

And the same with File-Uploads. With express framework I can already handle uploads really easy. How do I do this in Meteor? The documentation says nothing about it. So are there some plans to implement it? Or is there already a way?

like image 839
krevativ Avatar asked May 04 '12 16:05

krevativ


1 Answers

As far as REST goes: Meteor doesn't yet provide a supported API for serving HTTP from your application. This is intentional: in the not-too-distant future, your application server is likely to not be just a single process directly serving end users, but an arbitrarily parallelizable service behind a proxy tier. So we'll need to provide a supported API for responded to HTTP requests (for example, REST) that continues to work in such a setting.

If you really need to accept direct HTTP REST requests now, take a peek at how packages/accounts-oauth-helper/oauth_server.js uses __meteor_bootstrap__.app to hook into the Connect middleware framework. This will work for now, but we don't promise that Meteor will always be powered by Connect :)

Supporting REST endpoints is on Meteor's roadmap.

So is file uploads (that's what binary type refers to).

like image 94
David Glasser Avatar answered Sep 19 '22 04:09

David Glasser