Skip to content

Instantly share code, notes, and snippets.

@Enome
Created July 23, 2012 16:16
Show Gist options
  • Save Enome/3164486 to your computer and use it in GitHub Desktop.
Save Enome/3164486 to your computer and use it in GitHub Desktop.
var types = {
product: {
},
page: {
route: [ function (req, res, next) {}, function (req, res, next) {} ]
}
}
app.get('/:type', function (req, res, next) {
var type = types[req.params.type];
if (type.route) {
//walk type.route
}
res.render(req.params.type);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment