Exercise 1: The Database-Backed Catch-All — Possible Solution ==================================================================== // routes.js const pool = require('./db'); app.get('/*splat', async (req, res) => { const fullPath = req.params.splat.join('/'); const [rows] = await pool.query('SELECT * FROM pages WHERE full_path = ?', [fullPath]); if (rows.length === 0) { return res.status(404).render('404'); } res.render('page', { page: rows[0] }); }); CONFIRMATION ------------------------------ Given a real row in the pages table with full_path = 'programming/java', visiting /programming/java resolves req.params.splat to ['programming', 'java'], joined into 'programming/java', which the query matches exactly against that row's own full_path column - the real page's own title and body render. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly reconstructs the full path from the splat array, and correctly confirms a real stored page renders at its own matching URL.