More docs

This commit is contained in:
Ritchie 2013-06-05 17:16:00 -07:00
parent 22a55be841
commit 9dccc60f3c
1 changed files with 9 additions and 6 deletions

View File

@ -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(
Product,
Product.stats,
{
returns: {arg: 'stats', type: 'array'}, returns: {arg: 'stats', type: 'array'},
http: {path: '/info', verb: 'get'} 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