Complete the code to add a middleware that logs every request.
app.use([1]);The middleware function loggerMiddleware logs every request. It should be added with app.use().
Complete the code to parse JSON bodies in requests.
app.use([1]);express.urlencoded() for JSON parsingexpress.json() middleware parses incoming JSON request bodies and makes them available under req.body.
Fix the error in middleware order to ensure error handling works correctly.
app.use([1]);
app.use(errorHandler);The router middleware must come before the errorHandler. Error handlers should be last.
Fill both blanks to correctly order middleware for logging and JSON parsing.
app.use([1]); app.use([2]);
Logging middleware should run first to log all requests. JSON parsing middleware should run next to parse request bodies before routes.
Fill all three blanks to set up middleware in correct order: logging, JSON parsing, and error handling.
app.use([1]); app.use([2]); app.use([3]);
The correct order is: logging middleware first, then JSON parsing middleware, and finally the error handler last.