Skip to content

Fix missing <!--#include virtual--> replacements in db tossup/bonus routes#471

Merged
geoffrey-wu merged 4 commits intomainfrom
copilot/modify-routes-db-tossup-bonus
Mar 25, 2026
Merged

Fix missing <!--#include virtual--> replacements in db tossup/bonus routes#471
geoffrey-wu merged 4 commits intomainfrom
copilot/modify-routes-db-tossup-bonus

Conversation

Copy link
Contributor

Copilot AI commented Mar 25, 2026

/db/tossup/ and /db/bonus/ were serving raw HTML with unresolved <!--#include virtual="/head.html" --> and <!--#include virtual="/nav/index.html" --> directives — resulting in pages missing the shared <head> content and nav bar.

Changes

  • routes/db/tossup.js / routes/db/bonus.js: Load head.html, nav/index.html, and the template once at module init, applying <!--#include virtual--> substitutions upfront. Per-request work is reduced to the single dynamic description replacement.
const head = fs.readFileSync('./client/head.html', 'utf8');
const nav = fs.readFileSync('./client/nav/index.html', 'utf8');
const file = fs.readFileSync('./client/db/tossup/index.html', { encoding: 'utf8' })
  .replace('<!--#include virtual="/head.html" -->', head)
  .replace('<!--#include virtual="/nav/index.html" -->', nav);

Consistent with the pattern already used in routes/play/mp.js.

Original prompt

Modify routes/db/tossup and bonus to correctly replace <--#include virtual


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Fix routes to correctly replace include virtual statements Fix missing <!--#include virtual--> replacements in db tossup/bonus routes Mar 25, 2026
Copilot AI requested a review from geoffrey-wu March 25, 2026 01:41
@geoffrey-wu geoffrey-wu marked this pull request as ready for review March 25, 2026 01:46
@geoffrey-wu geoffrey-wu merged commit 28097c8 into main Mar 25, 2026
2 checks passed
@geoffrey-wu geoffrey-wu deleted the copilot/modify-routes-db-tossup-bonus branch March 25, 2026 01:47
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