๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout 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

Cross-Origin Resource Sharing (CORS)
An HTTP mechanism that allows web pages to request resources from a different domain than the one serving the page.
CORS Headers
HTTP headers that control cross-origin resource sharing between different domains, specifying allowed origins, methods, and headers.
Content Negotiation
An HTTP mechanism where client and server agree on the best representation of a resource based on format, language, or encoding preferences.
PHP
A widely-used server-side scripting language designed for web development that powers over 75% of websites including WordPress.
Lazy Loading
A technique that delays loading non-critical resources until they are needed, improving initial page load performance.
Web Components
A set of browser-native APIs for creating reusable, encapsulated custom HTML elements with their own styling and behavior.
View All Web Development Terms โ†’