simple:rest-method-mixin

v1.1.0Published 3 years ago

Compatibility

Compatible with Meteor 2.4

This repository provides versions for the package simple:rest-method-mixin that are compatible with latest Meteor. This is necessary because the author is not maintaining package anymore.

Changes

  • v1.1.0
    • api.versionsFrom on Package.onUse was changed from 1.2.1 to 2.4.

simple:rest-method-mixin

A mixin for mdg:validated-method to configure the HTTP endpoint for that Method when using simple:rest.

Use it like this:

1const method = new ValidatedMethod({
2  name: 'method',
3  mixins: [RestMethodMixin],
4  validate: ...,
5  restOptions: {
6    url: '/my-custom-url',
7    // any other options
8  },
9  run() {
10    return 5;
11  }
12});

This mixin just calls SimpleRest.setMethodOptions with the restOptions passed in.