Skip to content

Instantly share code, notes, and snippets.

@deveshkumar deveshkumar/2.js
Created Jun 30, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.