Closed ShrimpCryptid closed 4 months ago
The functions that do the url manipulation look complicated and unreadable enough to merit unit tests but that could be for a future ticket.
yeah... I could move this into index.tsx
and the functions into their own typescript files.
Taking this back to draft while I do some reworking!
@toloudis re-requesting your review because I've made some substantial changes. The reroute code now lives in a typescript file with unit tests, and I added more styling to the 404 page (as well as some webpack config changes).
Closes #213, removing hash routing on GitHub pages. This means we don't need to include the
#
character for subpaths anymore, so our S3 and GitHub Pages will use consistent link formats.Before:
https://allen-cell-animated.github.io/website-3d-cell-viewer/#/viewer
After:https://allen-cell-animated.github.io/website-3d-cell-viewer/viewer
Estimated size: medium, 20-25 minutes
Changes
This uses a custom 404 HTML page catch missing pages and reroute the browser to the viewer's base
index.html
page. The base page checks for the redirect and, if found, redirects internally to the correct page.See https://github.com/rafgraph/spa-github-pages for the original solution.
route_utils.tsx
for handling routing of URLs, and associated unit tests.reroute.tsx
and404.html
page to reroute missed traffic to the root single-page-app.index.tsx
to intercept the redirects and route the client to the correct page.Testing:
(this link will break after today so ping me if you want to see it again)