node-restful icon indicating copy to clipboard operation
node-restful copied to clipboard

before and after filters for multiple routes/whole resources

Open baugarten opened this issue 12 years ago • 0 comments

Set up a before/after route for the entire resource or path in resource. i.e.

model = restful.model(..);
model.before('*', function(req, res, next) {..});
model.before('path.*', function(req, res, next) {});
model.before('path.*', ['get', 'post'], function(req, res, next) {});

Can do this using express's wildcard routing fairly easily but the internal representation is harder

baugarten avatar Apr 02 '13 02:04 baugarten