appController.js 614 B

12345678910111213141516171819202122232425
  1. /*var restful = require('node-restful');
  2. module.exports = function(app, route) {
  3. // Setup the controller for REST;
  4. var rest = restful.model('app',app.models.app).methods(['get','put','post','delete']);
  5. //Resgister this endpoint with the application
  6. rest.register(app,route);
  7. // Return middleware.
  8. return function(req, res, next) {
  9. next();
  10. };
  11. };*/
  12. var Resource = require('resourcejs');
  13. module.exports = function(app, route) {
  14. // Setup the controller for REST;
  15. Resource(app, '', route, app.models.app).rest();
  16. // Return middleware.
  17. return function(req, res, next) {
  18. next();
  19. };
  20. };