Not found
A path of '*' matches anything. Routes match from the top down, so a catch-all placed last only ever sees the paths the routes above it did not take. That makes it the app's 404 page.
/albums/nope never reaches it: :id matches any segment, so the album route takes it, and Album.pzl shows its "isn't here" branch. A path like /records matches nothing until you add the catch-all.
Your turn
- Type
/recordsinto the address bar. The console reports that no route matches. - In
routes.js, importNotFoundfrom./views/NotFound.pzland add{ path: '*', name: 'not-found', view: NotFound, layout: Default }at the end of the table. - Try
/recordsagain, then/albums/nope.
Keep the catch-all last. Anything after it can never match.
That is the router. Chapter 4 gives Music a real datastore.