Route Middleware

Noun · Development

Definitions

  1. A function that intercepts an HTTP request before (or after) it reaches the route handler, performing cross-cutting concerns like authentication, logging, rate limiting, or body parsing. Middleware can modify the request/response objects, short-circuit the chain, or pass control to the next middleware via next().

    In plain English: Code that runs automatically before your main request handler, doing things like checking permissions or logging.

    Example: "We added rate-limiting middleware on the /api routes to cap each IP at 100 requests per minute."

Related Terms