connect-recaptcha

Handling recaptcha captchas without harming your poor route

npm install connect-recaptcha
10 downloads in the last week
31 downloads in the last month

DOCS


Well, connect-recaptcha is fairly simple:

var connect          = require('connect'),
    connectRecaptcha = require('connect-recaptcha');

var app = connect()
  .use(connect.logger('dev'))
  .use(connect.static('public'))
  .use(connect.bodyParser())
  .use(connectRecaptcha('pubkey', 'privkey'))
  .use(function(req, res) {
    if (req.recaptcha.error_code !== 'success')
      res.end('wrong captcha');

    res.end("you're a human, apparently");
  })
  .listen(1337);

It also supports a fallback url in case you want to completely astract your middleware:

var connect          = require('connect'),
    connectRecaptcha = require('connect-recaptcha');

var app = connect()
  .use(connect.logger('dev'))
  .use(connect.static('public'))
  .use(connect.bodyParser())
  .use(connectRecaptcha('pubkey', 'privkey', '/wrongcaptcha.html'))
  .use(function(req, res) {
    res.end("you're a human, apparently");
  })
  .listen(1337);
npm loves you