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()_.
I wonder how can we know which middleware should be use before another? I wonder if there already exist an ordered list (a list with all middlewares in correct working order) somewhere?
The list of middleware on connect’s home page is in the correct order, though it doesn’t explicitly call out dependencies.
Answered By – ebohlman