Exercise 3: Confirming Route Order Matters — Possible Solution ==================================================================== STEP 1 — WRONG ORDER ------------------------------ app.get('/*splat', async (req, res) => { const fullPath = req.params.splat.join('/'); // ...database lookup and render }); app.get('/admin', (req, res) => { res.send('Admin Dashboard'); }); Visiting /admin now never reaches the second route handler at all - Express matches the first registered route whose pattern fits, and /*splat matches literally every path, including /admin itself. The request is handled entirely by the catch-all, which looks up 'admin' in the pages table, finds no matching row, and returns a 404 instead of the real admin dashboard. STEP 2 — CORRECTED ORDER ------------------------------ app.get('/admin', (req, res) => { res.send('Admin Dashboard'); }); app.get('/*splat', async (req, res) => { const fullPath = req.params.splat.join('/'); // ...database lookup and render }); Visiting /admin now correctly reaches the specific /admin route first, since Express checks routes in the order they were registered and stops at the first match - the catch-all never gets a chance to intercept it. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly demonstrates the catch-all swallowing a more specific route when registered first, and correctly shows reordering the routes resolves the problem - concrete, observable proof of the same route-order gotcha already established across every sibling course.