allen-cell-animated / website-3d-cell-viewer

Other
5 stars 5 forks source link

Use browser routing (history API) instead of hash routing on #213

Closed ShrimpCryptid closed 4 months ago

ShrimpCryptid commented 4 months ago

Use Case

Upcoming PR #212 sets all "production mode" builds to use hash router instead of browser router.

Solution

Configure S3 to correctly route to the base index.html, and then modify the logic in index.tsx so it uses createBrowserRouter instead of createHashRouter.

Alternatives

Please describe any alternatives you've considered, even if you've dismissed them

ShrimpCryptid commented 4 months ago

See https://via.studio/journal/hosting-a-reactjs-app-with-routing-on-aws-s3 and the discussion on Simularium here: https://github.com/simularium/simularium-website/issues/498. Will need infra support for this.

Similar approach that can be used on GitHub pages, capturing + redirecting 404 errors: https://github.com/rafgraph/spa-github-pages