From 20533789d6ab4502ccf4970ee6167eb7f1195975 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Mon, 21 Dec 2020 00:13:22 +0100 Subject: [PATCH] docs: Update lighthouse docs --- plugins/lighthouse/README.md | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/plugins/lighthouse/README.md b/plugins/lighthouse/README.md index 1f1d32937f..42de0a2591 100644 --- a/plugins/lighthouse/README.md +++ b/plugins/lighthouse/README.md @@ -30,24 +30,17 @@ to enable the plugin: export { plugin as LighthousePlugin } from '@backstage/plugin-lighthouse'; ``` -Then, you need to use the `lighthouseApiRef` exported from the plugin to initialize the Rest API in -your [`apis.ts`](https://github.com/backstage/backstage/blob/master/packages/app/src/apis.ts). +Modify your app routes to include the Router component exported from the plugin, for example: -```js -import { ApiHolder, ApiRegistry } from '@backstage/core'; -import { Config } from '@backstage/config'; -import { - lighthouseApiRef, - LighthouseRestApi, -} from '@backstage/plugin-lighthouse'; +```tsx +import { Router as LighthouseRouter } from '@backstage/plugin-lighthouse'; -export const apis = (config: ConfigApi) => { - const builder = ApiRegistry.builder(); - - builder.add(lighthouseApiRef, LighthouseRestApi.fromConfig(config)); - - return builder.build() as ApiHolder; -} +// Inside App component + + // ... + } /> + // ... +; ``` Then configure the lighthouse service url in your [`app-config.yaml`](https://github.com/backstage/backstage/blob/master/app-config.yaml). @@ -86,7 +79,7 @@ const WebsiteEntityPage = ({ entity }: { entity: Entity }) => ( // ... } />