Middleware

Middleware is pipeline code in ASP.NET Core that handles requests and responses (logging, auth, routing, compression, etc.).

Middleware is pipeline code that runs for each HTTP request in ASP.NET Core. Middleware can inspect, modify, short-circuit, or pass the request along.

  • Common examples: authentication, routing, compression
  • Order matters
  • Can be custom for your app’s needs