Node.js · Middle · Question 30 of 75
Does the order of app.use() calls matter in Express?
- 1No, Express sorts them automatically
- ✓Correct answer: Yes, middleware and routes run in the order they are registered
- 3Only for static files
Explanation
For example, express.json() must be registered before routes that read req.body, and the error handler must be last.