Closed j-bullard closed 1 year ago
Thanks for the suggestion!
However, adding this natively would make it impossible to run the app that uses this router outside of the root path. Some people may very well want to run the app in paths like /app (for example), and that's a fully-supported scenario.
I noticed that if a user navigates to a page (i.e. http://example.com/login) and doesn't include the hash the index ("/") component is rendered instead of not found. To get by this, I added a small check to App.svelte that will check if the hash is present and if not, will replace the current url with one that includes the hash. Then, spa router will route accordingly.
Encountering
/login
would replace the url with/#/login
.Can this be added natively?