Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Middleware processes a request in a chain and may continue, end the response, or delegate an error. Earlier middleware can prepare data for later handlers.
For example, a JSON body parser must run before a route that reads the parsed body. Authentication middleware can establish a user before authorization checks. Middleware should either produce the response or pass control according to the framework's contract; otherwise a request may hang. Calling the continuation after responding can cause another handler to try to send a second response.