feat: make lighthouse url configurable

This commit is contained in:
Andrew Thauer
2020-08-29 17:25:35 -04:00
parent 314eeb31d7
commit d8877d4b7c
6 changed files with 26 additions and 6 deletions
+13 -5
View File
@@ -36,16 +36,24 @@ your [`apis.ts`](https://github.com/spotify/backstage/blob/master/packages/app/s
```js
import { ApiHolder, ApiRegistry } from '@backstage/core';
import { Config } from '@backstage/config';
import {
lighthouseApiRef,
LighthouseRestApi,
} from '@backstage/plugin-lighthouse';
const builder = ApiRegistry.builder();
export const apis = (config: ConfigApi) => {
const builder = ApiRegistry.builder();
export const lighthouseApi =
new LighthouseRestApi(/* your service url here! */);
builder.add(lighthouseApiRef, lighthouseApi);
builder.add(lighthouseApiRef, LighthouseRestApi.fromConfig(config));
export default builder.build() as ApiHolder;
return builder.build() as ApiHolder;
}
```
Then configure the lighthouse service url in your [`app-config.yaml`](https://github.com/spotify/backstage/blob/master/app-config.yaml).
```yaml
lighthouse:
baseUrl: http://your-service-url
```