You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's no obvious out of the box way to configure Spring Boot for client side routing with single page applications.
Most solutions found online rely on separation of paths such that you can easily tell frontend paths from API but this is not always possible. Also even that requires writing some extra code for what is nowadays an extremely common case and looks like everybody is reinventing this wheel poorly.
Most other web servers can be easily configured to serve index when static file can't be found.
Please add single property that enables such behavior, e.g. spring.resources.redirect-if-missing=/ that should forward to / in case requested resource was not found in spring.resources.static-locations.
Alternatively suggest how to implement it.
The text was updated successfully, but these errors were encountered:
Partially agree. The other ticket is more about fixing the underlying mechanism but this is request to make it work out of the box with a single property since it's an extremely common use case. I'd say spring-projects/spring-framework#27257 is a prerequisite to this.
There's no obvious out of the box way to configure Spring Boot for client side routing with single page applications.
Most solutions found online rely on separation of paths such that you can easily tell frontend paths from API but this is not always possible. Also even that requires writing some extra code for what is nowadays an extremely common case and looks like everybody is reinventing this wheel poorly.
Most other web servers can be easily configured to serve index when static file can't be found.
Please add single property that enables such behavior, e.g.
spring.resources.redirect-if-missing=/
that should forward to/
in case requested resource was not found inspring.resources.static-locations
.Alternatively suggest how to implement it.
The text was updated successfully, but these errors were encountered: