-
-
Save deveshkumar/5895651 to your computer and use it in GitHub Desktop.
5 Code Signals
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
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