Skip to content

Instantly share code, notes, and snippets.

@grauwoelfchen
Created November 14, 2013 17:16
Show Gist options
  • Save grauwoelfchen/7470614 to your computer and use it in GitHub Desktop.
Save grauwoelfchen/7470614 to your computer and use it in GitHub Desktop.
sample routes
// api - foo
module.exports = function(app) {
return {
foo: function(req, res) {
var id = req.params.id
req.user.foo(id).complete(function(error, foo) {
res.setHeader("Content-Type", "application/json");
res.render("json", { response: { data: foo, error: error } });
});
}
, ...
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment