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;