DEV Community

Discussion on: Explain Middleware like I'm five

Collapse
 
kspeakman profile image
Kasey Speakman

They are like browser extensions. Your web server often needs some plugins to do specific things like authentication or CORS. Middleware plugs into the web server to provide this functionality. It's called Middleware because it is code that is placed in between the web server and your app code. So the web server's request passes through it and sets up auth or CORS before it gets to your code.