Last active
December 26, 2015 20:59
-
-
Save Gerhut/7212391 to your computer and use it in GitHub Desktop.
Connect.js中间件大意。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logger 自定义格式、输出文件的日志 | |
csrf 跨站请求保护,需求session | |
compress gzip压缩 | |
basicAuth 简单http验证 | |
json application/json请求体解析到req.body | |
urlencoded application/x-www-form-urlencoded请求体解析到req.body | |
multipart multipart/form-data请求体解析到req.body | |
bodyParser = json + urlencoded + mutipart | |
timeout 请求超时 | |
cookieParser cookie解析到req.cookies | |
session session支持。估计是将session存到内存里 | |
cookieSession 将整个session存到cookie里 | |
methodOverride `_method`键改变请求类型 | |
responseTime 记录响应时间并记录到X-Response-Time回应头里 | |
staticCache 静态文件存到缓存里 | |
static 静态文件支持 | |
directory 目录列表支持 | |
vhost 不同的host转到不同的server | |
favicon (自定义/默认)站点图标 | |
limit 限制请求体的大小 | |
query 请求的QueryString解析到req.query | |
errorHandler 出错了直接输出500错误,错误内容写到回应体里 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment