Middlewares are functions that intercept HTTP requests before they reach the final handler. They allow:
Validation (e.g., authentication and security policies)
Request/response modification (e.g., GZIP compression)
Logging and monitoring (e.g, request logging and UUID tracking)