node.js - connect.js 中间件的正确顺序?

标签 node.js express connect

middleware depend on each other, for example methodOverride() checks req.body.method for the HTTP method override, however bodyParser() parses the request body and populates req.body. Another example of this is cookie parsing and session support, we must first use() cookieParser() followed by session()_.

我想知道我们怎么知道应该先使用哪个中间件?我想知道某处是否已经存在一个有序列表(一个包含所有中间件的正确工作顺序的列表)?

最佳答案

connect 上的中间件列表 home page顺序正确,尽管它没有明确指出依赖关系。

关于node.js - connect.js 中间件的正确顺序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11603701/

相关文章:

php - NodeJS Oboe 不向 PHP 服务器发送请求正文

javascript - 如何使用 NodeJS + ExpressJS 连接远程 phpMyAdmin 服务器

node.js - 如何使用 Bower 组件文件的正确路径设置 Node 项目

c# - 发送邮件失败,无法连接到远程服务器

ssl - 使用 WinHTTP 通过 CONNECT 和 POST 发送用户代理?

forms - Express js 正文解析器不起作用?

node.js - 在 NodeJs 中实现关键部分的正确方法

javascript - NodeJS - 服务器响应 404,然后加载页面

node.js - 检查 mongo 数据 key 是否存在

node.js - Jade 扩展不支持express.js