Skip to main content

Practice ยท 1 of 3

Pipeline Runner

Write runPipeline(middlewares, handler) โ€” middlewares is an array of functions (req, next); handler is (req). Each middleware may mutate req then must call next(). Return the final req after the full chain ran. If a middleware never calls next, the chain stops (and you still return the req as-is).

Difficulty: intermediate

Back to lesson: Practice: Middleware Pipeline โ€” Practice