1) HTTP middleware allows running code before and after the main request handler. Middleware can be used for logging, authentication, validation, and other pre- and post-processing of requests.
2) Middleware is added by wrapping the main handler, and middleware can call the next handler or short-circuit the request.
3) The alice package provides a cleaner way to chain multiple middlewares by avoiding nested functions. Middleware can access the request and response and call the next handler.