Skip to content

Commit

Permalink
Fix routing in hosted Static Web App (#19)
Browse files Browse the repository at this point in the history
* Add staticwebapp config

* Redirect 404 to index

* Move config to public

* Allow config update
  • Loading branch information
duckth authored Nov 10, 2023
1 parent dcc9fe6 commit 9043193
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Shifty.App/wwwroot/staticwebapp.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"trailingSlash": "auto",
"navigationFallback": {
"rewrite": "/index.html",
"exclude": ["/images/*.{png,jpg,gif}", "/css/*"]
},
"responseOverrides": {
"401": {
"redirect": "/Login",
"statusCode": 302
},
"404": {
"rewrite": "/index.html"
}
}
}
2 changes: 1 addition & 1 deletion infrastructure/shifty.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource staticwebapp 'Microsoft.Web/staticSites@2022-03-01' = {
tier: 'Free'
}
properties: {
allowConfigFileUpdates: false
allowConfigFileUpdates: true
repositoryUrl: 'https://github.com/AnalogIO/shifty-webapp'
branch: 'main'
provider: 'GitHub'
Expand Down

0 comments on commit 9043193

Please sign in to comment.