🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

connect-recaptcha

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-recaptcha

Handling recaptcha captchas without harming your poor route

0.1.2
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

connect

FAQs

Package last updated on 07 Sep 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts