From 8b46d766ee36baa86e24f77f6b9791718164b6d7 Mon Sep 17 00:00:00 2001 From: Boaz101 Date: Mon, 16 May 2022 11:34:13 -0400 Subject: [PATCH] docs: add example config for Azure Static Web App --- docs/guide/essentials/history-mode.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/guide/essentials/history-mode.md b/docs/guide/essentials/history-mode.md index bbed3c8ba..162a91e56 100644 --- a/docs/guide/essentials/history-mode.md +++ b/docs/guide/essentials/history-mode.md @@ -199,6 +199,20 @@ Create a `vercel.json` file under the root directory of your project with the fo } ``` +### Azure Static Web App +Create a staticwebapp.config.json file in the public folder with the following configuration. If the route does not exist, Azure will redirects all requests to index.html except for assets and favicons. +``` +{ + "navigationFallback": { + "rewrite": "/index.html", + "exclude": [ + "/assets/*", + "/favicons/*" + ] + } +} +``` + ## Caveat There is a caveat to this: Your server will no longer report 404 errors as all not-found paths now serve up your `index.html` file. To get around the issue, you should implement a catch-all route within your Vue app to show a 404 page: