From 6a39410e4fb06630fd5e0ac7f2e37d919afa6674 Mon Sep 17 00:00:00 2001 From: olli Date: Tue, 29 Oct 2024 18:24:41 +0100 Subject: [PATCH] Add staticwebapp azure config to handle dynamic route access --- staticwebapp.config.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 staticwebapp.config.json diff --git a/staticwebapp.config.json b/staticwebapp.config.json new file mode 100644 index 0000000..d8cd546 --- /dev/null +++ b/staticwebapp.config.json @@ -0,0 +1,35 @@ +{ + "trailingSlash": "auto", + "routes": [ + { + "route": "/*", + "serve": "/index.html", + "statusCode": 200 + } + ], + "navigationFallback": { + "rewrite": "index.html", + "exclude": ["/images/*.{png,jpg,gif}", "/css/*", "/js/*", "/fonts/*"] + }, + "responseOverrides": { + "400": { + "rewrite": "/" + }, + "401": { + "redirect": "/", + "statusCode": 302 + }, + "403": { + "rewrite": "/" + }, + "404": { + "rewrite": "/" + } + }, + "globalHeaders": { + "content-security-policy": "default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'" + }, + "mimeTypes": { + ".json": "text/json" + } +}