当前位置 : 主页 > 网页制作 > Nodejs >

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

来源:互联网 收集:自由互联 发布时间:2021-06-16
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 su

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上的中间件列表的顺序正确,但它没有明确地调用依赖项.
网友评论