JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11391
  • Score
    100M100P100Q123661F
  • License MIT

Implementation of google recaptcha solution in express

Package Exports

  • express-recaptcha

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-recaptcha) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

express-recaptcha Build Status

Google recaptcha for expressjs.

Link : https://www.google.com/recaptcha

installation

npm install express-recaptcha --save

usage

display

var express = require('express');
var pub = __dirname + '/public';
var app = express();
var Recaptcha = require('express-recaptcha');

app.use(express.static(pub));
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');

app.get('/', function(req, res){
  var captcha = new Recaptcha('SITE_KEY', 'SECRET_KEY');
  res.render('login', { captcha:captcha.toHtml() });
});

verify

app.post('/', function(req, res){
  var captcha = new Recaptcha('SITE_KEY', 'SECRET_KEY');
  captcha.verify({req: req},function(success, error){
    if (success)
      // your success code ...
    else if (error)
      // your error code ...
  });
});