diff --git a/lib/resource.js b/lib/resource.js index 4fcd3bf..1d2714c 100644 --- a/lib/resource.js +++ b/lib/resource.js @@ -159,7 +159,39 @@ Resource.prototype.load = function (fn) { */ Resource.prototype.handle = function (ctx, next) { - ctx.end(); + switch (ctx.method) { + case 'GET': + this.get(ctx, next); + break; + case 'POST': + this.post(ctx, next); + break; + case 'PUT': + this.put(ctx, next); + break; + case 'DELETE': + this.del(ctx, next); + break; + default: + next(); + break; + } +}; + +Resource.prototype.get = function(ctx, next) { + next(); +}; + +Resource.prototype.post = function(ctx, next) { + next(); +}; + +Resource.prototype.put = function(ctx, next) { + next(); +}; + +Resource.prototype.del = function(ctx, next) { + next(); }; /**