diff options
Diffstat (limited to 'app/node_modules/okrest')
| -rw-r--r-- | app/node_modules/okrest/index.js | 20 | ||||
| -rw-r--r-- | app/node_modules/okrest/package.json | 11 |
2 files changed, 31 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; diff --git a/app/node_modules/okrest/package.json b/app/node_modules/okrest/package.json new file mode 100644 index 0000000..462c890 --- /dev/null +++ b/app/node_modules/okrest/package.json @@ -0,0 +1,11 @@ +{ + "name": "okrest", + "version": "1.0.0", + "description": "nice", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "OKFocus", + "license": "None" +} |
