Skip to content

Instantly share code, notes, and snippets.

@jurberg
Created April 11, 2013 01:48
Show Gist options
  • Save jurberg/5360006 to your computer and use it in GitHub Desktop.
Save jurberg/5360006 to your computer and use it in GitHub Desktop.
app.all('/:controller/:action/:id?', function(req, res) {
require(['app/controller/' + req.params.controller], function(Controller) {
Controller[req.params.action](req, res);
});
});
app.all('/:controller', function(req, res) {
require(['app/controller/' + req.params.controller], function(Controller) {
Controller.index(req, res);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment