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

Fix application issue on reload when served by backend #2238

Merged
merged 1 commit into from
Jun 1, 2018

Conversation

nwmac
Copy link
Contributor

@nwmac nwmac commented May 31, 2018

When the backend is serving the UI - e.g. in the case of cf push, reloading was broken in the app - with Angular it uses "proper" URLs rather than the # - so the backend does not know about these routes and returns a 404 - to reproduce, cf push Stratos, navigate to part of the UI and hit the browser refresh button.

This PR fixes this - when the backend is serving the UI, it now adds an error handler and if the error is 404 and the request was not a backend API request, the application's index.html will be returned, allowing it to route correctly.

@nwmac nwmac self-assigned this May 31, 2018
@nwmac nwmac requested a review from irfanhabib May 31, 2018 07:27
@cfdreddbot
Copy link

Hey nwmac!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@nwmac nwmac changed the title Fix Angular url issue on reload when served by backend Fix application issue on reload when served by backend May 31, 2018
@codecov
Copy link

codecov bot commented May 31, 2018

Codecov Report

Merging #2238 into v2-master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           v2-master    #2238   +/-   ##
==========================================
  Coverage      71.78%   71.78%           
==========================================
  Files            565      565           
  Lines          23192    23192           
  Branches        5205     5205           
==========================================
  Hits           16649    16649           
  Misses          6543     6543

@KlapTrap KlapTrap merged commit 23a80c2 into v2-master Jun 1, 2018
@irfanhabib irfanhabib deleted the fix-jetstream-ui-serving branch June 28, 2018 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants