1.0.8 โข Published 2 years ago
webopenlq-captcha v1.0.8
๐ ้ช่ฏ็ -ไธ่ฝฝ
npm i webopenlq-captcha -S
๐ ้ช่ฏ็ -ไฝฟ็จ
const captcha = require('webopenlq-captcha')
let temp = captcha.create()
console.log(temp) // {text:'D3DS', data: '<svg></svg>'}
๐ ้ช่ฏ็ -็ปๅ http ๆจกๅ
const http = require('http')
const captcha = require('webopenlq-captcha')
http.createServer((req, res) => {
res.setHeader('content-type', 'text/html;charset=utf-8')
let temp = captcha.create()
// console.log(temp) // {text:'D3DS', data: '<svg></svg>'}
res.end(temp.data)
}).listen(3000, () => {
console.log('ๅฏๅจๆๅ๏ผ ่ฎฟ้ฎ http://localhost:3000');
})