Decorouter
Simple decorator based es6 class method routing for express nodejs
Installation
$ npm install decorouter --save
Usage
usage requiring babel-plugin-transform-decorators-legacy with babel 6
; { //usage not requiring babel-plugin-transform-decorators-legacy this 'methodWithoutDecorator'; } //additional handlers can be added after route eg (req, res, next) => next() @ { res; } //async methods can (and probably should) be used where neccessary @ async { res; } //additional handlers can be added after route eg (req, res, next) => next() @ { res; } { res; } //will defaut to 'get' and '/defaultRouteAssignedByMethodName' @ { res; }
Registering routes
;;; let router = express;; //or all in this directory;