🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Web Development Intermediate

What is Middleware?

Software that sits between the request and response in a web application, performing processing like authentication or logging.

Middleware functions form a pipeline that processes HTTP requests and responses. Each middleware can inspect, modify, or reject requests before passing them to the next handler. Common middleware handles authentication, CORS, compression, rate limiting, and logging.

In Express.js, middleware uses next() to pass control. In Laravel, middleware classes handle the request pipeline. The order of middleware execution matters — authentication should run before authorization, for example.

Related Terms

CORS Preflight
An automatic OPTIONS request sent by browsers before certain cross-origin requests to check if the actual request is permitted.
Sitemap XML
An XML file that lists all important URLs on a website, helping search engines discover and crawl content efficiently.
Server-Sent Events
A server push technology that enables a server to send real-time updates to a browser over a single HTTP connection.
Static Site Generator (SSG)
A tool that generates a complete static HTML website from templates and content at build time, requiring no server-side processing.
Web Vitals
Google's metrics for measuring user experience quality, including loading speed, interactivity, and visual stability of web pages.
CORS Headers
HTTP headers that control cross-origin resource sharing between different domains, specifying allowed origins, methods, and headers.
View All Web Development Terms →