Repository navigation
Add GET /api routes for player names and draw history - #688
Merged
Merged
Conversation
Replaces the ddr-tools-api proxies on Val Town (which is shutting down) with official routes on the party Worker: - /api/e/:eventId/cab/:cabId/player/:playerIndex — plain-text name of the player at that position in the cab's active match, or 204 with an x-empty-reason header - /api/e/:eventId/draws — every drawing in the event as JSON Both read the room's Durable Object state directly instead of fetching /parties/main/<room> over HTTP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
It uses the workers-runtime Env global, so like worker.ts and server.ts it's only checked by tsconfig.worker.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… API The old full-draw-history proxy answered at /e/:eventId, so with its val.run redirect pointed at live.ddr.tools/api the path lands here unchanged. docs/api.md covers both routes for users, linked from the OBS guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the two
ddr-tools-apivals on Val Town, which is shutting down, with official routes on the party Worker (live.ddr.tools). User-facing docs are indocs/api.md, linked from the OBS guide.ddr-tools-raw-player-name.val.run/e/:eventId/cab/:cabId/player/:nlive.ddr.tools/api/e/:eventId/cab/:cabId/player/:nddr-tools-full-draw-history.val.run/e/:eventIdlive.ddr.tools/api/e/:eventId/draws(also/api/e/:eventId)Both val.run addresses will redirect to
https://live.ddr.tools/apiwith the path kept. Every old URL then lands on a matching route with no extra mapping. That's why draw history also answers at the bare/api/e/:eventId.text/plain. If there's no cab, no active drawing, or no player at that index, it returns204with the samex-empty-reasonheader the val sent, so existing OBS text sources behave the same.Object.values(drawings.entities)as JSON. The val'sdelete c.song.chartsstep is gone: drawn charts no longer carry asongobject, so it was a no-op at best.getServerByName) instead of making an HTTP round trip to/parties/main/<room>. They sendAccess-Control-Allow-Origin: *. Any non-GET request to/api/*gets a 405, and an unknown/api/*path gets a 404.src/party/api.tsis Worker-only code, so it's excluded from the root (DOM)tsconfig.json, the same asworker.tsandserver.ts.Testing
yarn validate:types:ts(both configs),oxlint, andoxfmt --checkpass.wrangler devand checked:[]at both/api/e/:idand/api/e/:id/draws;/parties/main/<room>still working.🤖 Generated with Claude Code