webopen-captcha
v1.0.3
Published
这是一个svg-captcha 验证码模块
Downloads
7
Readme
下载
npm i webopen-captcha -g
或
npm i webopen-captcha -S
使用-结合http模块
const http = require('http')
const svgCaptcha = require('webopen-captcha')
const app = http.createServer((req, res) => {
const captcha = svgCaptcha.create();
res.setHeader('content-type', 'text/html;charset=utf-8')
res.end(captcha.data)
})
app.listen(3000, () => {
console.log('启动成功,访问 http://localhost:3000');
})