Public: anyone can read this; the crew can change it.
forked from trevato/cs
The reference gets an address: the weapons and damage tables become a page you can link to #289
Check · Review · Land · Live done — Landed and live in production.
The weapons and damage tables now have an address of their own: `GET /weapons`, rendered by `src/pages/weapons.ts` — the module that already rendered them — so the whole reference is one link you can paste.
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
The weapons and damage tables now have an address of their own:
GET /weapons, rendered bysrc/pages/weapons.ts— the module that already rendered them — so the whole reference is one link you can paste.What changed.
src/pages/weapons.tsgains two things beside the section it already had:weaponsPage, the whole document through the same shell every game is served inside, andweaponsSummary, what the shooter's page carries in the tables' place.src/server.tsadds one read route, outsidesrc/games.tsbecause this is not a game — no bundle, no assets, no state, nothing to run — but on exactly a game's terms: its own style block hashed into its ownstyle-src, the security floor, gzip throughsend, HEAD for free, and the body rendered and weighed once at start-up like the 404's, so a hit is a map lookup and a write of bytes that already exist (measured at under a millisecond against a live server).Summary, not a closed
<details>. A<details>still ships every byte of the tables to every visitor, and the shooter's page not shipping them was the point. What is left on/is four measured figures and the link — how many guns, how many thrown, what the dearest costs, and which weapons kill with one shot to a helmeted head (today: Knife, Desert Eagle, AK-47 and AWP) — all read off the samesrc/sheet.ts, so the teaser cannot promise what the tables do not say. The menu's hint now points at/weaponsinstead of#weapons, and the#weaponsCSS moved out of the shooter's style block with the section.Bytes, on an empty database, gzipped and raw:
/10,028 / 33,164 → 8,442 / 23,933;/weaponsis 4,649 / 16,968 and downloads no bundle. The budgets insrc/server.test.tsare/12,000 → 10,500 and/weapons5,600; on the suite's own filled database/measures 8,830. The two pages together are more bytes than the one was, because the shell is paid for twice — no visit pays for both.Tests that would fail without this: the route answers 200 with every weapon in the registry and the damage table; the shooter links it and no longer contains a row, a scroll box or an assumption of it;
weaponsPagehanded a registry with a weapon added renders it in both tables with nobody editing the page;/weaponsis in the gzip test, the style-hash loop and the byte budget. The #224 checks are untouched and still hold every digit againstcombat.ts.bun run testis green: 1,250 pass.What I did not do:
/weaponsis not in the header's nav — that list is the registry of games, and adding a non-game to it is a shell change that belongs with #255 rather than here. The 404 likewise still lists only the games. In the preview, try/weapons, print it (⌘P) to see the paper view, and check that/still says the same numbers it links to.🤖 Generated with Claude Code
Closes #272