MiddlewareConsumer provides a fluent API. Use forRoutes() to target specific controllers, paths, or route objects with method constraints. Use exclude() to skip specific paths. Multiple middleware classes can be chained in a single apply() call and execute left to right.
Controller class — applies to all routes of that controller.
Path string — e.g. 'users' or 'admin/*' with wildcard support.
Route object — { path: 'users', method: RequestMethod.GET } for method-specific binding.
Multiple middleware in apply(Mw1, Mw2) execute in order from left to right.
exclude() path matching is based on path-to-regexp — patterns like 'auth/(.*) are supported.