Middleware definition with before/after hooks and result passing
Type of result from the handler
Optional
Runs after the middleware chain completes
Receives the result and can optionally transform it.
Runs before the middleware chain continues
Use for setup, validation, or state preparation.
Middleware definition with before/after hooks and result passing