【文件属性】:
文件名称:reply-to-visit:回答问题以访问该站点
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-19 06:48:17
JavaScript
reply-to-visit
在网站前面设置一道关卡, 回答问题以获得网站的访问权限
用法:
const path = require('path')
const port = 3000
const app = require('reply-to-visit')(port) // 如果不传递port参数, 默认是3000端口
// 设置问题回答正确之后允许访问的内容的目录, 可以设置多次, 访问时按顺序检索
app.serveStatic(path.resolve(__dirname, '../static')) // root path
app.serveStatic('sub-path', path.resolve(__dirname, '../sub-path'))
app.addQuestion
(
{
question: '________, 彬彬有礼',
【文件预览】:
reply-to-visit-master
----.gitignore(39B)
----package.json(588B)
----LICENSE(1KB)
----index.js(579B)
----static()
--------index.html(165B)
----test.js(712B)
----README.md(977B)
----lib()
--------db()
--------questions()
--------config.js(83B)
--------entry.js(534B)
--------midelewares()
----.npmignore(39B)