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

Support client side routing out of the box #27554

Open
mwisnicki opened this issue Aug 4, 2021 · 3 comments
Open

Support client side routing out of the box #27554

mwisnicki opened this issue Aug 4, 2021 · 3 comments
Labels
type: enhancement A general enhancement

Comments

@mwisnicki
Copy link

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 4, 2021
@wilkinsona
Copy link
Member

Here's an example of other people wrestling with this problem.

@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 17, 2021
@philwebb philwebb added this to the General Backlog milestone Aug 17, 2021
@wilkinsona
Copy link
Member

This is probably a duplicate of spring-projects/spring-framework#27257.

@mwisnicki
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants