From 362ea5a7286d7db7bf5d57d21cc1c16b3ccf4a26 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 7 Aug 2021 14:12:07 +0200 Subject: [PATCH] app,create-app: fix index path redirect Signed-off-by: Patrik Oldsberg --- .changeset/neat-meals-arrive.md | 12 ++++++++++++ .../software-catalog/catalog-customization.md | 2 +- packages/app/src/App.tsx | 2 +- .../templates/default-app/packages/app/src/App.tsx | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .changeset/neat-meals-arrive.md diff --git a/.changeset/neat-meals-arrive.md b/.changeset/neat-meals-arrive.md new file mode 100644 index 0000000000..292d98de26 --- /dev/null +++ b/.changeset/neat-meals-arrive.md @@ -0,0 +1,12 @@ +--- +'@backstage/create-app': patch +--- + +Updated the index page redirect to work with apps served on a different base path than `/`. + +To apply this change to an existing app, remove the `/` prefix from the target route in the `Navigate` element in `packages/app/src/App.tsx`: + +```diff +- ++ +``` diff --git a/docs/features/software-catalog/catalog-customization.md b/docs/features/software-catalog/catalog-customization.md index 8d209cc8f0..07258a55cb 100644 --- a/docs/features/software-catalog/catalog-customization.md +++ b/docs/features/software-catalog/catalog-customization.md @@ -187,7 +187,7 @@ new `CustomCatalogIndexPage`. # packages/app/src/App.tsx const routes = ( - + - } /> + } /> ``` diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index de62971f96..13bdcbd2e6 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -98,7 +98,7 @@ const AppRouter = app.getRouter(); const routes = ( - + } /> - + } />