-
Notifications
You must be signed in to change notification settings - Fork 153
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
Missing resources resolution #26
Comments
Hi @Opalo! Thanks for your awesome remarks. Yes SinglePageAppConfig is a bit fragile. Thanks 😄 |
@geowarin, will try. Could you please specify the business logic for this resolver? As far as I understood from the comment (on the top of the class) it should redirect all |
The idea is to redirect all non-resource (resources are like css, images, etc.) requests to the index.html. I don't remember exactly where I got the idea of whitelisting the resources extensions for the fallback but I do not think it is the best way to go anymore. The best implementation that I found is what the history API fallback used in server.js does. Algorithm:
I think I tried to be smart and handle multiple html files but that's clearly over-engineered when I look back at it. PS: The react-router docs also suggest an implementation. |
@geowarin, thanks for the input. The algorithm you specified is possible to implement in |
I don't know much about resource resolution in Spring either. If you are still motivated, trust your instincts and we'll review any PR your send our way to try and catch potential mistakes; |
Closing in favor of #30 |
Hi,
First of all, great job! Thanks!
I've question regarding missing resources resolution, SinglePageAppConfig class in particular.
First of all, please replace
orElseGet(null)
withorElse(null)
.orElseGet
will throw NPE when null is passed whereasorElse
will returnnull
.Secondly, you wrote that if a requested view is not found it should be redirected to
index.html
. It will not work.some.html
is handled - according to extension - then it's not found and null will be returned - this is howresolve
method logic works now.The text was updated successfully, but these errors were encountered: