1.0.3 • Published 3 years ago
webopen-captcha v1.0.3
下载
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');
})