Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    connect-recaptchapublic

    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);

    Keywords

    none

    install

    npm i connect-recaptcha

    Downloadsweekly downloads

    15

    version

    0.1.2

    license

    none

    last publish

    collaborators

    • avatar