Implement a Client-Side Express-Style Router Middleware Engine
Build a lightweight client-side router middleware system where you can register route handlers with .use(path, handler) and .get(path, handler). When a route is matched, pass the request through a chain of middleware functions (req, res, next) in order, allowing each to modify the request/response or stop propagation by not calling next(). This is the core of Express.js routing and is asked when companies want to test your understanding of middleware chains, request lifecycle, and single-page app routing internals.