1.0.4 • Published 1 year ago
yangdq475-demo1 v1.0.4
下载
npm i yangdq475-demo1 -S
使用
const captcha = require('yangdq475-demo1')
let mm = captcha.create()
console.log(mm) // {text:'字符串', data: '<svg>...</svg>'}
结合http
const http = require('http')
const yangdq475-demo1 = require('yangdq475-demo1');
const app = http.createServer((req,res)=>{
const temp = yangdq475-demo1.create(); //{data:svg数据,text:文本}
res.setHeader('content-type', 'text/html;charset=utf-8')
res.end(temp.data)
})
app.listen(3000,()=>{
console.log('启动成功,访问http://localhost:3000');
})