Run logic before your request reaches the rest of the NestJS pipeline.
Middleware runs during the request-response process before the request reaches the route handler. It can inspect or modify the request and response objects, or perform tasks such as logging and request preprocessing.
Middleware is useful for concerns that apply broadly to incoming requests, but it is not always the right place for authentication, authorization, validation, or response transformation. NestJS provides guards, pipes, and interceptors for those more specific responsibilities.
What you'll walk away knowing