jarrtyme-captcha

1.0.2 • Public • Published

***如何使用 ***下载包 npm i jarrtyme-captcha -S ***引入包 const captcha = require('jarrtyme-captcha') ***调出包方法 let temp = captcha.create() console.log(temp)

***结合http模块使用 ***引入http包 const http = require('http') ***引入jarrtyme-captcha包 const captcha = require('jarrtyme-captcha') ***调用createServer函数 http.createServer((req, res) => { 定义响应头参数 res.setHeader('content-type', 'text/html;charset=utf-8') 调用包方法 let temp = captcha.create() 输出 res.end(temp.data) 启动监听 }).listen(3000, () => { console.log('启动成功, 访问 http://localhost:3000'); })

/jarrtyme-captcha/

    Package Sidebar

    Install

    npm i jarrtyme-captcha

    Weekly Downloads

    1

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    3.98 kB

    Total Files

    3

    Last publish

    Collaborators

    • jarrtyme