Skip to content

Instantly share code, notes, and snippets.

@deveshkumar
Created June 30, 2013 16:24
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/5895821 to your computer and use it in GitHub Desktop.
Save deveshkumar/5895821 to your computer and use it in GitHub Desktop.
5 Code Signals
app.put('/api/friends/:_id', function (req, res){
return Friends.findById(req.params._id, function (err, friend) {
friend.name = req.body.name;
return friend.save(function (err) {
if (!err) {
console.log("updated friend");
} else {
console.log(err);
}
return res.send(friend);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment