Skip to content

Instantly share code, notes, and snippets.

@niftydigits
Created February 7, 2011 13:23
Show Gist options
  • Select an option

  • Save niftydigits/814344 to your computer and use it in GitHub Desktop.

Select an option

Save niftydigits/814344 to your computer and use it in GitHub Desktop.

Revisions

  1. @iwootten iwootten created this gist Feb 7, 2011.
    16 changes: 16 additions & 0 deletions app2.js#blog
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    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('/')
    });
    });