Skip to content

Instantly share code, notes, and snippets.

@howarddierking
Created June 7, 2012 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 howarddierking/2889557 to your computer and use it in GitHub Desktop.
Save howarddierking/2889557 to your computer and use it in GitHub Desktop.
RestBugs Node POST sample
app.post('/bugs/working', function(req, res){
db.bugs.find({_id:req.body.id}, function(err, doc){
doc.activate(req.body.comments);
db.bugs.update({_id:req.body.id}, doc, function(err, updatedDoc){
db.bugs.find({status:'Working'}, function(err, docs){
res.render('bugs-all.html', {
title: "Working",
model: { bugs : docs }});
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment