My blog post: Let's Build a CAPTCHA Generator with Node.js
๐ Keep those nasty bots out with a home-grown CAPTCHA!
npm i
npm start
All routes default to 200x100 size unless specified.
-
/test/:width?/:height?/
- Get a web page with an image element to manually test the API.
-
/captcha/:width?/:height?/
- Get a CAPTCHA object for proper usage.
{ "image": <data url>, "text": <validation text> }
Uses Jest to run integration tests.
npm test
n.b. CAPTCHAs are not accessible and in some cases not even effective.