Middleware Pattern
Chaining handlers for logging and auth
What is middleware?
Middleware is a function that wraps an http.Handler to add cross-cutting behaviour (logging, auth, recovery) without modifying the handler's business logic.
Middleware signature
A middleware is a function that takes an http.Handler and returns an http.Handler:
type Middleware func(http.Handler) http.HandlerAll lessons in this course
- Creating an HTTP Server
- Routing and Path Parameters
- Middleware Pattern
- Graceful Shutdown