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

404 on Refresh Fix #830

Merged

Conversation

ralikio
Copy link
Member

@ralikio ralikio commented Aug 21, 2024

Description

The following solution is adaption of https://stackoverflow.com/a/64687181 to provide default route to ui app if the file server does not contain given path. The file server returns 404 path if requested path does not correspond to any files in its filesystem. Because of that while routing request to our single page app (e.g. path "/instances/{id}") the request was handled by file server and not by the app itself (which corresponds to index.html). The solution routes existing paths, like "/static/*", to the file server and non existing, like "/instances/{id}", to the app frontend.

Related issue(s)

#442

The following solution is adaption of https://stackoverflow.com/a/64687181 to provide default route to ui app if the file server does not contain given path. The file server returns 404 path if requested path does not correspond to any files in its filesystem. Because of that while routing request to our single page app (e.g. path "/instances/{id}") the request was handled by file server and not by the app itself (which corresponds to `index.html`). The solution routes existing paths, like "/static/*", to the file server and non existing, like "/instances/{id}", to the app frontend.
@ralikio ralikio requested a review from a team as a code owner August 21, 2024 10:38
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 21, 2024
@ralikio ralikio added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/bug Categorizes issue or PR as related to a bug. labels Aug 21, 2024
Copy link
Contributor

@szwedm szwedm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kyma-bot kyma-bot added the lgtm Looks good to me! label Aug 21, 2024
@szwedm szwedm removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 21, 2024
@szwedm szwedm merged commit fc39203 into kyma-project:sm-integration Aug 21, 2024
13 of 14 checks passed
szwedm pushed a commit that referenced this pull request Aug 21, 2024
* Added Generic UI Mapping

The following solution is adaption of https://stackoverflow.com/a/64687181 to provide default route to ui app if the file server does not contain given path. The file server returns 404 path if requested path does not correspond to any files in its filesystem. Because of that while routing request to our single page app (e.g. path "/instances/{id}") the request was handled by file server and not by the app itself (which corresponds to `index.html`). The solution routes existing paths, like "/static/*", to the file server and non existing, like "/instances/{id}", to the app frontend.

* Linter
kyma-gopher-bot pushed a commit that referenced this pull request Aug 22, 2024
* Added Generic UI Mapping

The following solution is adaption of https://stackoverflow.com/a/64687181 to provide default route to ui app if the file server does not contain given path. The file server returns 404 path if requested path does not correspond to any files in its filesystem. Because of that while routing request to our single page app (e.g. path "/instances/{id}") the request was handled by file server and not by the app itself (which corresponds to `index.html`). The solution routes existing paths, like "/static/*", to the file server and non existing, like "/instances/{id}", to the app frontend.

* Linter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm Looks good to me! size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants