Learn
That
Stack
Ace your next interview
Tech Stacks
Cheatsheets
Interview Questions
Sign in
Tech Stacks
Cheatsheets
Interview Questions
Sign in
Home
Interview Questions
Express.js
What are the different types of middleware in Express.js?
Back to Express.js
All Backend Development
Previous
Next
What are the different types of middleware in Express.js?
Beginner
Answer
Application-level middleware
- Bound to app object using
app.use()
Router-level middleware
- Bound to router object using
router.use()
Error-handling middleware
- Takes four arguments (err, req, res, next)
Built-in middleware
- Provided by Express (express.static, express.json)
Third-party middleware
- From npm packages (morgan, cors, helmet)
Back to Express.js
Previous Question
Next Question
Explanation
AI Powered
Generating explanation with Claude AI...
This will use 10 credits
credits used
Close
Close