-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestions: enable using publications and meteor methods #15
Comments
Hey Satya,
Restivus.addRoute 'test', authRequired: true,
get: ->
Meteor.call('someMeteorMethod', @userId, arg2) |
Working on a package that has this as its main feature here: https://github.com/stubailo/meteor-rest Hoping to have a first version out on Tuesday, but until then here is a hackpad with design and discussion: https://meteor.hackpad.com/Meteor-Hack-Week-REST-APIs-with-Meteor-XK2NNXqhUvj |
@stubailo's |
Not sure if this is possible, but to have more DRY code it would be useful to be able to
Because in a publication you already limit what you publish of a collection. There's a big chance your API exposure won't differ, but that means duplication of code in endpoint actions.
2. use meteor methods in endpoint actionsBecause you already have your methods set up to do something with your collections. So if you could use those it means you don't have to duplicate code.
UPDATE: just figured out that is possible, with the exception that Meteor.userId() is not set. So if you protected your methods with check for userId the API can't run the method.
The text was updated successfully, but these errors were encountered: