Exercise 1: What Happens If the Catch-All Route Is Registered First — Possible Solution ==================================================================== WHAT WOULD ACTUALLY HAPPEN ------------------------------ Express matches routes in the exact order they're registered, and checks each one in turn until it finds a match. app.get("*", ...) matches every possible path, with no exceptions. If it were registered before the API routers, a request to /api/items would reach that catch-all route first, since Express stops looking once it finds a matching route - the actual itemsRouter registered later would never even get a chance to handle the request. The server would respond with index.html's own contents instead of a JSON list of items. WHY NO ERROR WOULD APPEAR ANYWHERE ------------------------------ From Express's own point of view, nothing went wrong at all - a route matched the request, and that route successfully sent a response (status 200, with real HTML content). There's no exception, no failed request, no log entry indicating a problem. The React frontend making the request would receive a 200 response and try to parse HTML as if it were the JSON it expected, likely failing in whatever code processes that response - a confusing failure far downstream from its actual cause. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains Express's own first-match routing behavior and why the catch-all's universal pattern would intercept API requests before they ever reach the real API router, and correctly explains why this produces a "successful" HTML response rather than any visible server-side error - making the actual cause hard to trace without knowing about route registration order specifically.