Created
November 14, 2013 17:16
-
-
Save grauwoelfchen/7470614 to your computer and use it in GitHub Desktop.
sample routes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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