1.0.8 • Published 6 years ago

reply-to-visit v1.0.8

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

npm

npm

npm

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: '________, 彬彬有礼',
        tip: '南湖公园长椅',
        answer: '婉婉有仪'
    },
)
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago