Repository navigation
fix(client): keep served files inside the game and website folders - #127
Merged
Merged
Conversation
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.
What does this PR do?
No linked issue (fix found during an org issue triage).
The client server now resolves request paths for
/game/*and/*inside the game folder and the website folder, and answers 404 for anything outside them. The website folder is resolved withfileURLToPath, which also fixes installs whose path contains spaces.Note:
/package.jsonon the client now returns 404 (it used to serve the website'spackage.json); the website never requests it.How do you test this PR?
bun testinapps/client: 5 pass, 0 failpnpm lint,pnpm build,pnpm test:unit: pass (also run by the pre-push hook)bun run dist/server.js -p <port> -d <game dir>): in-folder files,/and/index.htmlreturn 200; paths that resolve outside the game or website folder return 404.Merge danger
Door: two-way (revert is enough)
Blast radius: small,
@nanoforge-dev/loader-client; reaches@nanoforge-dev/cliusers after a loader release and a CLI bump. Nothing deploys on merge.Quality gate
docs/docs/client.mdxFollow-up issues
None