Level 1 · Apprentice0 XP
A request walks through handlers. Each one acts, passes it on, or stops it.
Step 1 / 5
ProblemhandleRequest() authenticates, checks the rate limit, validates the body, logs, then runs the business code. It is two hundred lines. A team that needs CORS has to edit the same method as the team that needs tracing.
← → step
Before this: Template Method
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write three handlers with the same shape (log, authenticate, rate limit) and a function that chains them in front of a final handler. Run a request with and without a token, then swap the order of two handlers and describe what changed.