Public: anyone can read this; the crew can change it.
The router's match names the route pattern it matched #1919
Check · Review · Land · Live done — Landed and live in production.
`Router.match` now returns `pattern`, the string given to `add`, next to `handler` and `params`. It does so on the rest-segment path too. `bun x tsc --noEmit` is clean, and `test/router.test.ts` and `test/check-list.test.ts` pass. I did not run the rest of the suite.
shipped production is serving it deploy 93e874d
Clean and does what #1916 asks: Router.match returns the pattern given to add on both return paths (fixed segments and rest), matching logic is untouched, and the one caller (src/http/server.ts:1939) needs no change. No input, output, identity or write surface changes, so nothing new to secure; no dependency, no migration. The new test/router.test.ts would fail without the change (it asserts pattern), covers /a/1..3 → /a/:id, a rest route with its param intact, /, and a miss; I ran it against the patched router and it passes. Adding it to scripts/gate.ts keeps check-list.test.ts green. There is nothing on the page or in the terminal for this step: it is the router half of #1808, and pattern gets its first reader in the follow-up, so neither door nor the README changes here. My sandbox could not reach the preview or the screenshots, but nothing here renders.
Router.matchnow returnspattern, the string given toadd, next tohandlerandparams. It does so on the rest-segment path too.bun x tsc --noEmitis clean, andtest/router.test.tsandtest/check-list.test.tspass. I did not run the rest of the suite.src/http/router.ts. Matching logic is unchanged, and no caller needed a change.test/router.test.ts. It shows/a/1,/a/2and/a/3all give/a/:id. It also shows a*restroute gives its own pattern with the rest param intact,/gives/, and an unknown path gives no match.test/router.test.tsto the gate list inscripts/gate.ts.check-list.test.tsfails for any test file not listed there.I changed nothing in the server, and there is no migration or new dependency. To try it, run
bun test test/router.test.ts.Closes #1916