From 91428a8986d93220326ec9c36da2c51f069c667f Mon Sep 17 00:00:00 2001 From: Alexey Belozerov Date: Sat, 12 Apr 2014 18:34:09 +0700 Subject: [PATCH] default, default_get actions are added --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index 7789c21..c0afcaa 100644 --- a/index.js +++ b/index.js @@ -30,6 +30,8 @@ var orderedActions = [ , 'update' // PUT /:id , 'patch' // PATCH /:id , 'destroy' // DEL /:id + , 'default_get' + , 'default' ]; /** @@ -240,6 +242,12 @@ Resource.prototype.mapDefaultAction = function(key, fn){ case 'destroy': this.del(fn); break; + case 'default_get': + this.get('/*', fn); + break; + case 'default': + this.all('/*', fn); + break; } };