baucis-decorators
Some helper methods for decorating baucis
controllers. Controllers can inherit decorators from other controllers.
Usage
Use npm install baucis-decorators --save
along with any decorators you'd like to use. See this query for Loggur's current list.
Quick Example
controllers/User.js
var baucis = ;var decorators = ;var doSomething = ; // `UserController` will inherit `ResourceController`'s decoratorsvar ResourceController = ; // ensure model is initializedvar UserModel = ; // create REST endpoint using `baucis`var UserController = baucis; // decorate controllerdecoratorsadd; /** Alternatively use a string and omit the above `require` statement:decorators.add.call(UserController, [ 'baucis-decorator-do-something', ResourceController]); **/ /** * Expose controller. */moduleexports = UserController;
Detailed Example
See baucis-decorators-example
. Use as many decorators as you want. A handful of decorators depend on other decorators.
Decorators List
For now, see this query. Submit a pull request if you'd like to add decorators of your own to this README.