feathers-commands
Create custom commands/routes for services beyond the 6 basic methods provided by FeathersJS
Install
$ npm install feathers-commands
Usage
const app = // Register apiapp; // Create serviceapp; // Register commandsapp; app;
Running commands internally
app;app;
Running commands via REST
POST /myService/sayHello => 'Hello to Mr. undefined'
POST /myService/sayHello/Mrs {"name":"Angela"} => 'Hello to Mrs. Angela'
POST /myService/getStatus/def456 => '<status>'
POST /myService/getStatus => 404 NOT FOUND
Hooks
Hooks will be invoked for custom commands just like they do for the 6 native methods
app
this
context
Commands will be invoked under the service context, meaning that this
refers to the feathers-wrapped service object.
websocket support
Currently websocket transporters such as Primus and Socket.IO aren't directly supported. PRs are welcome.
License
MIT © Daniel Kalen