Skip to content

Instantly share code, notes, and snippets.

@deveshkumar
Created June 30, 2013 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deveshkumar/5895651 to your computer and use it in GitHub Desktop.
Save deveshkumar/5895651 to your computer and use it in GitHub Desktop.
5 Code Signals
app.get('/api/friends', function(req,res,next){
Friends.find({user_id: req.currentUser.id }).exec(function (err, friend_list) {
if (err) {
return next(err);
}
if (friend_list) {
res.send(friend_list);
} else {
return next(new NotFound('Could not find any such Friend'));
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment