Middleware sits between incoming requests and your route handlers. Each middleware function can: inspect/modify the request, inspect/modify the response, call the next middleware, or end the request. Common uses: authentication (verify JWT), logging, CORS headers, rate limiting, body parsing, error handling. In Express: app.use(middleware). In Next.js: middleware.ts at the root.
glossary2 min read
Middleware Explained
Middleware functions process requests between client and server logic.
Try these tools
More glossary articles
What is WebP?
WebP is a modern image format by Google offering superior compression. Learn when and how to use WebP images.
What is HEIC?
HEIC is the default photo format on iPhones. Learn what it is, why Apple uses it, and how to convert it.
What is JSON?
JSON (JavaScript Object Notation) is the standard data format for web APIs. Learn the syntax and common uses.
What is Regex?
Regular expressions (regex) are patterns for matching text. Learn the basics and common use cases.