Skip to content

Instantly share code, notes, and snippets.

@deveshkumar
Created June 30, 2013 16:04
Show Gist options
  • Save deveshkumar/5895746 to your computer and use it in GitHub Desktop.
Save deveshkumar/5895746 to your computer and use it in GitHub Desktop.
5 Code Signals
app.get('/api/friends/:_id',function(req,res,next){
Friends.findOne({ '_id': req.params._id , 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