【文件属性】:
文件名称:prefer.js:HTTP首选标头中间件
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-08 23:22:58
JavaScript
HTTP首选中间件
连接用于首选标头的中间件( )
安装:
npm install prefer-js
例子:
var app = require('express')();
app.use(require('prefer'));
app.get('/', function(req,res) {
var prefer = req.prefer;
if (prefer.handling === 'strict') {
// strict handling
} else if (prefer.handling === 'lenient') {
// lenient handling
}
if (prefer.respondAsync) {
// client prefers async response
}
if (prefer.wa
【文件预览】:
prefer.js-master
----package.json(615B)
----test()
--------test.js(1KB)
----SIGNED.md(2KB)
----.gitignore(13B)
----README.md(1KB)
----prefer.js(2KB)
----.jshintrc(54B)