Interview Hub
Sign in

Q19: What is middleware in Express-style apps?

MidWeb 29

Answer

Functions (req, res, next) that run in sequence; they can end the response or call next() to continue. Used for auth, logging, parsing body, errors. Interview: contrast with single handler per route and discuss error-handling middleware (err, req, res, next).

Having a tech or coding interview? Check 29 JavaScript & Node.js interview questions.

EditorJavaScript · local only