ai-code-battle/web/pages.json
jedarden 79f3bee8a9 fix(web): serve replays from same-origin /data/ static assets, not R2
Replays are bundled into the Pages deploy as gzipped static assets (B2 stays
the private cold archive). Repoint all replay/card/thumbnail/live.json fetches
off the empty R2 cache and the non-resolving b2.aicodebattle.com onto
same-origin /data/, via a shared fetchReplayFromUrl helper that gunzips
.json.gz with DecompressionStream.

- new web/src/lib/replay-data.ts (REPLAY_BASE, replayUrl, fetchReplayFromUrl)
- replay.ts / embed.ts / pages/embed.ts / playlist-carousel.ts use the helper
- og-tags, bot-card, home, matches, bot-profile, playlists, feedback, ambient,
  api-types: /r2/ -> /data/
- pages.json data_paths updated; friendlier 404 message preserved
- 21 web tests pass; npm run build OK

Closes: bf-5cwi

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:41:30 -04:00

30 lines
846 B
JSON

{
"name": "ai-code-battle",
"description": "AI Code Battle - Competitive bot programming platform",
"domains": [
"aicodebattle.com"
],
"build": {
"command": "npm run build",
"output_dir": "dist",
"root_dir": "web"
},
"routes": {
"app": "index.html",
"replay_viewer": "replay.html"
},
"data_paths": {
"pages_data": "/data",
"replay_data": "/data/replays (gzipped static assets bundled into the deploy by the index builder)"
},
"deployment": {
"method": "wrangler pages deploy",
"git_integration": true,
"index_builder_deploys": "data/ directory only"
},
"notes": [
"SPA uses hash-based routing (no _redirects needed)",
"Index files in data/ are deployed by Rackspace index builder every ~90 min",
"Replays and per-match data are served from R2 custom domain"
]
}