The Road to Wildcard Routing
The original asset system was embarrassingly simple: every image used by the site was registered as an individual route. Forty-five files. Forty-five lines in the registration function. If we added an image, we added a line. Safe. Predictable. Limiting.
The problem: the Theia A100 generates hundreds of character renders. The overnight sheet pipeline produces character art for biblical figures in batches of eight. The WO30125 design system produced sixty webp files in a single run. If we kept the individual-route model, we would need to add sixty lines every time Theia shipped a batch — and we would constantly be discovering images that existed on disk but had no route.
The fix was small: add wildcard prefix matching to the router. The router did exact string comparisons. We added a second pass: after exact matching fails, check if any registered route ends with `*` and if the request path starts with the prefix. Then register one route: `GET /assets/*`.
The result: any file in `web/assets/` is now served automatically, with path safety checks. One wildcard route unlocked 1,062 files. The character art from Theia, the environment backplates from the atlas, the pilgrim concept renders, the lion turnaround sheets — all served without a single additional line of route registration.
This is how DAVAR grows. Not by patching individual gaps. By understanding the pattern and changing the structure.