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

Proper way to serve the same static file for multiple routes in the context of a single page application #1286

Open
vgu-natbraille opened this issue Sep 27, 2023 · 0 comments

Comments

@vgu-natbraille
Copy link

vgu-natbraille commented Sep 27, 2023

Hi.

In a browser, history and routes can be set with javascript (i.e. got to subroutes like /login, /documents/...) so the user can navigate without reloading, but when the page is reloaded - or directly accessed, as these route are not defined, the browser gets a 404.

I can define these route as serving the content of my root index.html, but it kind of defeats the purpose of having a staticFiles.externalLocation() method.

Am I missing something ? If not so, it would be very convenient if there was an easy way to serve the same static file for multiple routes.

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

No branches or pull requests

1 participant