Fix routes

Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Johan Haals
2021-02-16 11:06:20 +01:00
parent 285deed5de
commit 0b7cb92258
9 changed files with 58 additions and 68 deletions
@@ -36,16 +36,14 @@ Add the following entry to the head of your `packages/app/src/plugins.ts`:
export { scaffolderPlugin } from '@backstage/plugin-scaffolder';
```
Next we need to install the three pages that the scaffolder plugin provides. You
can choose any name for these routes, but we recommend the following:
Next we need to install the root page that the Scaffolder plugin provides. You
can choose any path for the route, but we recommend the following:
```tsx
import { TemplateIndexPage, TemplatePage, TaskPage } from '@backstage/plugin-scaffolder';
import { ScaffolderPage } from '@backstage/plugin-scaffolder';
// Add to the top-level routes, directly within <FlatRoutes>
<Route path="/create" element={<TemplateIndexPage />} />
<Route path="/create/templates/:templateName" element={<TemplatePage />} />
<Route path="/create/tasks/:taskId" element={<TaskPage />} />
<Route path="/create" element={<ScaffolderPage />} />;
```
You may also want to add a link to the template index page to your sidebar: