MockReCaptchaApi.js 458 B

123456789101112131415161718192021
  1. const AbstractMockApi = require('./AbstractMockApi')
  2. class MockReCaptchaApi extends AbstractMockApi {
  3. applyRoutes() {
  4. this.app.post('/recaptcha/api/siteverify', (req, res) => {
  5. res.json({
  6. success: req.body.response === 'valid',
  7. })
  8. })
  9. }
  10. }
  11. module.exports = MockReCaptchaApi
  12. // type hint for the inherited `instance` method
  13. /**
  14. * @function instance
  15. * @memberOf MockReCaptchaApi
  16. * @static
  17. * @returns {MockReCaptchaApi}
  18. */