Review, Research, and Discussion

Name 3 real world use cases where you’d want to change the request with custom middleware

  1. Validation.
  2. Logging.
  3. Error handling.

True or false: The route handler is middleware?

In what ways can a middleware function end the process and send data to the browser?

It can end with the response variable such as “response.send()”.

At what point in the request lifecycle can you “inject” middleware?

What can cause express to error with “Request headers sent twice, cannot start a second response”

References

Main page