More docs
This commit is contained in:
parent
22a55be841
commit
9dccc60f3c
15
README.md
15
README.md
|
@ -150,7 +150,7 @@ Define a remote model instance method.
|
||||||
|
|
||||||
Both instance and static methods can be exposed to clients. A remote method must accept a callback with the conventional `fn(err, result, ...)` signature.
|
Both instance and static methods can be exposed to clients. A remote method must accept a callback with the conventional `fn(err, result, ...)` signature.
|
||||||
|
|
||||||
##### Model.expose(method, [options]);
|
##### asteroid.remoteMethod(Model, fn, [options]);
|
||||||
|
|
||||||
Expose a remote method.
|
Expose a remote method.
|
||||||
|
|
||||||
|
@ -158,14 +158,17 @@ Expose a remote method.
|
||||||
myApi.getStats('products', fn);
|
myApi.getStats('products', fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
asteroid.remoteMethod('stats', {
|
asteroid.remoteMethod(
|
||||||
returns: {arg: 'stats', type: 'array'},
|
Product,
|
||||||
http: {path: '/info', verb: 'get'}
|
Product.stats,
|
||||||
});
|
{
|
||||||
|
returns: {arg: 'stats', type: 'array'},
|
||||||
|
http: {path: '/info', verb: 'get'}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
**Options**
|
**Options**
|
||||||
|
|
||||||
- **instance** - (default: false) specify the remote method is an [instance method](#instance-method)
|
|
||||||
- **accepts** - (optional) an arguments description specifying the remote method's arguments. A
|
- **accepts** - (optional) an arguments description specifying the remote method's arguments. A
|
||||||
- **returns** - (optional) an arguments description specifying the remote methods callback arguments.
|
- **returns** - (optional) an arguments description specifying the remote methods callback arguments.
|
||||||
- **http** - (advanced / optional, object) http routing info
|
- **http** - (advanced / optional, object) http routing info
|
||||||
|
|
Loading…
Reference in New Issue