Skip to content

Move bone data to server#394

Merged
leandrumartin merged 16 commits into
mainfrom
issue-352-new
Jun 15, 2026
Merged

Move bone data to server#394
leandrumartin merged 16 commits into
mainfrom
issue-352-new

Conversation

@leandrumartin

@leandrumartin leandrumartin commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Summary

Closes #352

A brief description/summary of your PR here. What does it add? Why is it necessary? How was the change made, and how was it tested?

Bone data is now stored directly on the server, copied over from the data branch. The server code has been rewritten to fetch the data from these files instead of from GitHub.

Screenshots

If applicable, add screenshots showing the before and after of any UI changes made.

PR Checklist

  • Project builds and runs
  • Tests and linters pass
  • Any related documentation has been updated, including JSDoc comments or docstrings

Detailed Description

A more detailed description and any additional information.

An Express endpoint is created for images with

app.use("/api/images", express.static(IMAGES_DIR));

to replace the previous functionality whereby the server would send the frontend the URL of each image. Now, the URL provided is this endpoint so that the images can be pulled from the Express server rather than GitHub.

Comment thread boneset-api/server.js Fixed
Comment thread boneset-api/server.js
try {
const response = await axios.get(url, { timeout: 10_000 });
return { data: response.data, status: response.status };
const raw = await fs.readFile(resolvedPath, "utf8");

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??? This code was your suggestion. But fine

…ed in path expression'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Comment thread boneset-api/server.js Fixed
Comment thread boneset-api/server.js Fixed
…ed in path expression'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Comment thread boneset-api/server.js Fixed
…ed in path expression'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Comment thread boneset-api/server.js Fixed
… data used in path expression'"

This reverts commit 829804d.
… data used in path expression'"

This reverts commit 0e60c4a.
… data used in path expression'"

This reverts commit 4d4b33b.
@leandrumartin

Copy link
Copy Markdown
Collaborator Author

@copilot Review ONLY the changes to the file boneset-api/server.js. Make NO CHANGES to the file; instead, ONLY add comments to this thread, acting as a code reviewer.

Copilot AI commented Jun 15, 2026

Copy link
Copy Markdown

@copilot Review ONLY the changes to the file boneset-api/server.js. Make NO CHANGES to the file; instead, ONLY add comments to this thread, acting as a code reviewer.

One blocking issue in boneset-api/server.js: API_BASE_URL is hardcoded to http://127.0.0.1:${PORT}, so /api/bone-data/ returns image URLs that won’t work for non-local clients/deployments. Please return relative URLs (e.g. /api/images/${encodeURIComponent(filename)}) or derive the host from the incoming request.

@leandrumartin leandrumartin merged commit 7d2b1b1 into main Jun 15, 2026
5 of 6 checks passed
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.

Move data from separate branch into server folder on main branch

4 participants