diff options
| author | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-01 18:27:51 -0400 |
|---|---|---|
| committer | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-01 18:27:51 -0400 |
| commit | 2e041ff6cd1b40c26bf16d37777c2c1c5153a669 (patch) | |
| tree | 1e427659faf343bf42795beae8980000436617b8 /app/node_modules/okrest/index.js | |
| parent | ae24790e8122296b06f88fa883b8e272c6454d46 (diff) | |
Bootstrappin young lad
Diffstat (limited to 'app/node_modules/okrest/index.js')
| -rw-r--r-- | app/node_modules/okrest/index.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/node_modules/okrest/index.js b/app/node_modules/okrest/index.js new file mode 100644 index 0000000..169626d --- /dev/null +++ b/app/node_modules/okrest/index.js @@ -0,0 +1,20 @@ +var OKView = require('okview'); + +/** + * OKRestEndpoint! + * Takes a resources and creates a CRUD endpoint. + */ +function OKRestEndpoint(resource, options) { + if (!(this instanceof OKRestEndpoint)) return new OKRestEndpoint(resource, options); + options = options || {}; + this._resource = resource; +} + +OKRestEndpoint.prototype.middleware = function() { + var self = this; + return function handleREST(req, res, next) { + res.send(self._resource.name); + }; +} + +module.exports = OKRestEndpoint; |
