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 routing in hosted Static Web App #19

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Fix routing in hosted Static Web App #19

merged 4 commits into from
Nov 10, 2023

Conversation

duckth
Copy link
Member

@duckth duckth commented Nov 10, 2023

This addresses an issue in the hosted Azure Static Web App, where navigating directly to a sub-page, or doing a refresh, will result in a 404 error. This happens because Blazor does client-side routing that intercepts the native browser navigation, so without navigating through the actual app, there is no way for the host to know how to resolve the routes.

To fix this, the config will now fallback to "index.html" when pages are missing, which will allow the client-side routing to kick in and navigate correctly.

@duckth duckth requested a review from TTA777 November 10, 2023 12:35
@duckth duckth self-assigned this Nov 10, 2023
Copy link
Member

@TTA777 TTA777 left a comment

Choose a reason for hiding this comment

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

Lgtm

@TTA777 TTA777 merged commit 9043193 into main Nov 10, 2023
2 checks passed
@TTA777 TTA777 deleted the feature/fix-routing branch November 10, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants