stubailo / meteor-rest

:sleeping: simple:rest - make your Meteor app accessible over HTTP and DDP alike
https://atmospherejs.com/simple/rest
MIT License
382 stars 85 forks source link

Publications not available via http options #152

Open ghost opened 6 years ago

ghost commented 6 years ago

I noticed that every method has both POST and OPTIONS enabled by default, however, that's not true for publications. I am currently working on an angular project in order to integrate with my meteor app, and most of the GET requests are antecipated by an OPTIONS request, which in turn are not available as meteor rest endpoints. I've been using the code below as a workaround, but I consider it error-prone and not productive at all: I'm always going back to my code looking for some error when I realize I just forgot to add these three lines...

JsonRoutes.add('options', '/publications/my_publication_collection', (req, res) => {
    JsonRoutes.sendResult(res, {});
});

My current packages are: simple:rest simple:json-routes simple:rest-json-error-handler simple:rest-accounts-password simple:authenticate-user-by-token