Skip to content

Add domain parameter to scans API with influenza default, propagate through game orchestrator#1

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/attach-domain-to-scans-api
Draft

Add domain parameter to scans API with influenza default, propagate through game orchestrator#1
Copilot wants to merge 2 commits intomainfrom
copilot/attach-domain-to-scans-api

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 25, 2026

The game server had no way to scope word selection to a specific domain — all word lists were hardcoded client-side with no API-level domain filtering.

Changes

  • GET /api/scans endpoint — accepts ?domain= query param, returns { domain, words }. Defaults to "influenza" when omitted. Returns 404 with available domains on unknown domain.

  • domains dictionary — server-side word lists keyed by domain (influenza, javascript, machinelearning). influenza contains 34 epidemiological terms (e.g., hemagglutinin, oseltamivir, surveillance).

  • Orchestrator (submit-number) — now accepts optional domain from the client, defaults to "influenza". Domain and its word list are stored in game state and emitted to both players on start-game.

// Client can now specify a domain when joining a game
socket.emit("submit-number", { number: 42, name: "Alice", domain: "influenza" });

// Server emits domain context back on match
socket.on("start-game", ({ opponentName, gameId, domain, domainWords }) => { ... });

// Or query words directly via REST
GET /api/scans              { domain: "influenza", words: [...] }
GET /api/scans?domain=javascript  { domain: "javascript", words: [...] }

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
battleships Ready Ready Preview, Comment Feb 25, 2026 7:48am
duckiepoppie Ready Ready Preview, Comment Feb 25, 2026 7:48am
mini-games Ready Ready Preview, Comment Feb 25, 2026 7:48am
othelloduck Error Error Feb 25, 2026 7:48am

…nza'

Co-authored-by: dhvanithakkar <113112823+dhvanithakkar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants