From 0c733c38d78ceedcf600029574b978ffaee68fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Tr=C3=B8strup?= <8415722+Duckth@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:18:01 +0100 Subject: [PATCH 1/4] Add staticwebapp config --- infrastructure/staticwebapp.config.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 infrastructure/staticwebapp.config.json diff --git a/infrastructure/staticwebapp.config.json b/infrastructure/staticwebapp.config.json new file mode 100644 index 0000000..e269f2c --- /dev/null +++ b/infrastructure/staticwebapp.config.json @@ -0,0 +1,16 @@ +{ + "trailingSlash": "auto", + "navigationFallback": { + "rewrite": "index.html", + "exclude": ["/images/*.{png,jpg,gif}", "/css/*"] + }, + "responseOverrides": { + "401": { + "redirect": "/Login", + "statusCode": 302 + }, + "404": { + "rewrite": "/404.html" + } + } +} From 84b5a3c6965a895dbce421e5d0e6fd55cae86e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Tr=C3=B8strup?= <8415722+Duckth@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:36:49 +0100 Subject: [PATCH 2/4] Redirect 404 to index --- infrastructure/staticwebapp.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/staticwebapp.config.json b/infrastructure/staticwebapp.config.json index e269f2c..4a3801d 100644 --- a/infrastructure/staticwebapp.config.json +++ b/infrastructure/staticwebapp.config.json @@ -10,7 +10,7 @@ "statusCode": 302 }, "404": { - "rewrite": "/404.html" + "rewrite": "/index.html" } } } From ea490e06ef2cca53033d67492ac3553c46830342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Tr=C3=B8strup?= <8415722+Duckth@users.noreply.github.com> Date: Fri, 10 Nov 2023 13:06:42 +0100 Subject: [PATCH 3/4] Move config to public --- {infrastructure => Shifty.App/wwwroot}/staticwebapp.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {infrastructure => Shifty.App/wwwroot}/staticwebapp.config.json (89%) diff --git a/infrastructure/staticwebapp.config.json b/Shifty.App/wwwroot/staticwebapp.config.json similarity index 89% rename from infrastructure/staticwebapp.config.json rename to Shifty.App/wwwroot/staticwebapp.config.json index 4a3801d..968a109 100644 --- a/infrastructure/staticwebapp.config.json +++ b/Shifty.App/wwwroot/staticwebapp.config.json @@ -1,7 +1,7 @@ { "trailingSlash": "auto", "navigationFallback": { - "rewrite": "index.html", + "rewrite": "/index.html", "exclude": ["/images/*.{png,jpg,gif}", "/css/*"] }, "responseOverrides": { From 41b433055e91daa096fd4d21bf23cccbae3c9ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Tr=C3=B8strup?= <8415722+Duckth@users.noreply.github.com> Date: Fri, 10 Nov 2023 13:13:17 +0100 Subject: [PATCH 4/4] Allow config update --- infrastructure/shifty.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/shifty.bicep b/infrastructure/shifty.bicep index 70bfb71..ad9cebe 100644 --- a/infrastructure/shifty.bicep +++ b/infrastructure/shifty.bicep @@ -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'