I rebuilt my side project's router with Spider and kept the diff small. Every page is one line that names a path and a handler.
server
.get("/posts", list, .{})
.get("/posts/:id", show, .{})
What I deleted
- The route table I used to keep in sync by hand.
- One controller function per page.
- Any doubt about what a handler receives, since the signature is the same everywhere.
The dynamic part, /posts/:id, reads straight from the path.