Make the React app the site root; remove home.html; fix dataset thumbnails#30
Merged
Merged
Conversation
…taset thumbnails - Remove public/home.html so the build serves only the React SPA. The committed nginx config (deploy/nginx-bodymaps.conf) serves dist/index.html at / with SPA fallback, so the React app becomes the main page and /home.html resolves to it too. - Fix missing dataset thumbnails: route the HuggingFace fallback through the same-origin /api/proxy-image proxy instead of a direct cross-origin URL, which the viewer's COEP: require-corp header was blocking (verified: direct HF returns a 302 redirect; the proxy returns a 200 image/jpeg).
…one) The deploy only runs git pull -> npm run build -> restart gunicorn (no nginx step), and the live server serves home.html at the root. So: - build now copies dist/index.html -> dist/home.html, making home.html the React app. Whatever the server serves at / (home.html or index.html) is now the SPA, so the React app becomes the main page without any nginx/sudo change. - add a /home.html -> / redirect route so old bookmarks land on the app, not a blank React route.
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.
Summary
Makes the React SPA the main site (replacing the standalone
home.html) and fixes the dataset thumbnails that were blank under the viewer's COEP header. Works with the existing README deploy steps — no nginx change required.Changes
public/home.html("CT Finder" page).dist/home.htmlas a copy ofdist/index.html— so whatever the server serves at the root (home.htmlorindex.html) is the React app. This makes the React app the main page without touching nginx./home.html→/in the router so old bookmarks land on the app, not a blank route.Previewfell back to a direct cross-origin HuggingFace image, which the site'sCross-Origin-Embedder-Policy: require-corpheader blocks. Now the fallback goes through the same-origin/api/proxy-imageproxy (the approach the old home.html used). Verified: direct HF →302redirect (blocked under COEP); proxy →200 image/jpeg.Deploy
Just the normal README steps — no extra/nginx/sudo work:
After this,
bodymaps.wse.jhu.edu/serves the React app (Landing → Dataset → Upload → Viewer); the old page is gone.Testing
dist/home.htmlidentical todist/index.html.