1611 shaares
17 private links
17 private links
Middleware is a function that receives the request and response objects of an HTTP request/response cycle. It may modify (transform) these objects before passing them to the next middleware function in the chain. It may decide to write to the response; it may also end the response without continuing the chain.
In other frameworks “middleware” is called “filters”, but the concept is the same: a request, response, and some transformation functions.