Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to rewrite all urls to /index.html #167

Closed
peterpeterparker opened this issue Jul 13, 2023 · 0 comments · Fixed by #169
Closed

Option to rewrite all urls to /index.html #167

peterpeterparker opened this issue Jul 13, 2023 · 0 comments · Fixed by #169
Assignees

Comments

@peterpeterparker
Copy link
Contributor

peterpeterparker commented Jul 13, 2023

Context

Juno is expecting developers to use SSG / prerendering. For example, if an URL /marketplace/sales is requested and if there is no /marketplace/sales/index.html or /marketplace/sales.html available in the dapp, nothing is resolved and the URL ends in error.

Solution

Similar to Firebase, we can add an option "Configure as a single-page app (rewrite all urls to /index.html)?"

When set to true, if an URL /marketplace/sales would resolve no asset, then it should fallback to the root ./index.html.

Firebase

Firebase does more than "just" rewriting to ./index.html it also provide a configurable way to provide multiple rewrites.

https://firebase.google.com/docs/hosting/full-config#rewrites

Certified asset canister

This strategy exists for example on the IC in the certified asset canister.

See:

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 a pull request may close this issue.

1 participant