docs: update plugin installation docs

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-04-15 20:12:33 +02:00
parent 610619dba0
commit c614ede9a5
25 changed files with 152 additions and 283 deletions
+5 -14
View File
@@ -31,26 +31,17 @@ When you have an instance running that Backstage can hook into, first install th
$ yarn add @backstage/plugin-lighthouse
```
Then make sure to export the plugin in
your app's [`plugins.ts`](https://github.com/backstage/backstage/blob/master/packages/app/src/plugins.ts)
to enable the plugin:
```js
export { plugin as LighthousePlugin } from '@backstage/plugin-lighthouse';
```
Modify your app routes in `App.tsx` to include the Router component exported from the plugin, for example:
Modify your app routes in `App.tsx` to include the `LighthousePage` component exported from the plugin, for example:
```tsx
// At the top imports
import { Router as LighthouseRouter } from '@backstage/plugin-lighthouse';
import { LighthousePage } from '@backstage/plugin-lighthouse';
// Inside App component
<Routes>
<FlatRoutes>
// ...
<Route path="/lighthouse/*" element={<LighthouseRouter />} />
<Route path="/lighthouse" element={<LighthousePage />} />
// ...
</Routes>;
</FlatRoutes>;
```
Then configure the `lighthouse-audit-service` URL in your [`app-config.yaml`](https://github.com/backstage/backstage/blob/master/app-config.yaml).