1.0.8 โ€ข Published 2 years ago

webopenlq-captcha v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

๐Ÿš€ ้ชŒ่ฏ็ -ไธ‹่ฝฝ

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');
})