【文件属性】:
文件名称:connect-is-bot:当机器人,搜索引擎,蜘蛛等提出请求时,将“ isBot”添加到请求中
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-04 12:08:58
JavaScript
连接是机器人
当来自机器人,搜索引擎,蜘蛛等的请求时,将isBot添加到请求中。
安装
npm install connect-is-bot --save
用法
var isBot = require ( 'connect-is-bot' ) ;
app . use ( isBot ( ) ) ;
->它将属性req.isBot添加到来自机器人,搜索引擎,蜘蛛等的每个请求中。 例如,当请求包含“用户代理”标头时:
“ Mozilla / 5.0(兼容; Googlebot / 2.1; + )”,
属性req.isBot设置为true 。
学分
它使用gjohnson的is-bot模块。
【文件预览】:
connect-is-bot-master
----.gitignore(592B)
----README.md(587B)
----LICENSE(1KB)
----package.json(675B)
----index.js(246B)