Skip to content

Instantly share code, notes, and snippets.

@dandean
Created March 7, 2011 19:26
Show Gist options
  • Select an option

  • Save dandean/859039 to your computer and use it in GitHub Desktop.

Select an option

Save dandean/859039 to your computer and use it in GitHub Desktop.
app.get("/users/:username/sites", function(req, res) {
riak.add("sites")
.map(predicates.findByPropertyValue, ["owner", req.params.username])
.run(function(e, result, meta) {
if (e) {
res.fail("There was an error while getting sites for this user.", meta.statusCode);
return;
}
res.ok(result, meta.statusCode);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment