【文件属性】:
文件名称:type-is:推断请求的内容类型
文件大小:11KB
文件格式:ZIP
更新时间:2021-02-03 19:49:51
nodejs javascript http type HTTPJavaScript
类型是
推断请求的内容类型。
安装
这是通过提供的模块。 使用完成 :
$ npm install type-is
API
var http = require ( 'http' )
var typeis = require ( 'type-is' )
http . createServer ( function ( req , res ) {
var istext = typeis ( req , [ 'text/*' ] )
res . end ( 'you ' + ( istext ? 'sent' : 'did not send' ) + ' me text' )
} )
【文件预览】:
type-is-master
----.travis.yml(3KB)
----.eslintrc.yml(29B)
----index.js(5KB)
----HISTORY.md(6KB)
----package.json(1KB)
----test()
--------.eslintrc.yml(19B)
--------test.js(12KB)
----LICENSE(1KB)
----.gitignore(69B)
----README.md(5KB)
----.eslintignore(22B)