simple:rest-method-mixin

v1.0.1Published 8 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

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.