Exp 09 — nested routes

Three routes under one node.

This heading is rendered by a Layout two levels down from the document. The root Layout wrote the <html> around it; this one wraps every route under /builds, and the component below is whichever one matched.

Layout sees
/builds
Params, from getContext()
{}

Live specimen — builds/index.server.tsx

Two children sit under this node and both of them match the URL /builds/new: a static new and a param :id. Static beats param, left to right, and the route table is sorted at build time — so declaration order is never consulted and the static one wins however the two are written.

The same records are served as JSON by an API route, which renders nothing and enters no Walk: /api/builds answers GET and POST, and /api/builds/:id answers GET. That node carries no component at all, so a method it does not handle is a 405 rather than a page.