We have a custom server that is serving our svelte app on a single URL endpoint. This svelte app is made to be an SPA. Our app has a few pages you can visit, making use of the client side routing for navigating the pages such that the URL would also change as different pages are navigated to.
What i cant seem to find, is any information on how you are supposed to handle URL changes in the browser such as a refresh or navigating to another page. Naturally, changing the url will send it directly to the server for which we do not have a service running, we only have a single endpoint that hosts the SPA svelte app.
I would have presumed svelte has some sort of mechanism to catch URL changes and handle the request in its own internal routing mechanism but cannot find anything related. Is what i am suggesting even possible or am i missing something?
The closest i can find is this navigation subscription that triggers when the browsers url is triggered but is this how its supposed to be detected? Otherwise i can only think of using this hook to make it call the app serving endpoint instead of whatever is called but then is there no way to simply get svelte to load a certain page instead of sending the url request? I guess this is probably for when you have server end points for your routes and not applicable in an SPA.
Any help or clarification would be appreciated.