Skip to content

Instantly share code, notes, and snippets.

@niftydigits
Created February 7, 2011 13:23
Show Gist options
  • Save niftydigits/814344 to your computer and use it in GitHub Desktop.
Save niftydigits/814344 to your computer and use it in GitHub Desktop.
app.get('/blog/new', function(req,res){
res.render('blog_new', {
locals: {
title: 'New Post'
}
});
});
app.post('/blog/new', function(req,res){
articleProvider.save({
title: req.param('title'),
body: req.param('body')
}, function(error, docs) {
res.redirect('/')
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment