Promptles
Backend & APIs

Middleware

intermediate

Definition

Code that sits in the middle of a request, doing some prep work before the main action runs. It might check that you're logged in, write a note in the log, or unpack the data you sent: handling the routine stuff so the main code can stay focused on its real job.

In the wild

When you open your bank's dashboard, middleware first checks 'is this person actually signed in?' Only if the answer is yes does the request reach the code that fetches your account balance. The middleware acts like a doorman.

More from Backend & APIs