From d181a6fc50a4ce99022078e2024f93a2edca8494 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Wed, 28 Aug 2024 15:23:22 +0200 Subject: [PATCH] simplify example Signed-off-by: Johan Haals --- docs/backend-system/core-services/url-reader.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docs/backend-system/core-services/url-reader.md b/docs/backend-system/core-services/url-reader.md index 27b9658eda..242ffd2307 100644 --- a/docs/backend-system/core-services/url-reader.md +++ b/docs/backend-system/core-services/url-reader.md @@ -60,22 +60,16 @@ import { createServiceFactory, UrlReaderService, } from '@backstage/backend-plugin-api'; -import { ScmIntegrations } from '@backstage/integration'; - -type CustomIntegrationConfig = { - // custom config fields -}; +import { Config } from '@backstage/config'; class CustomUrlReader implements UrlReaderService { static factory: ReaderFactory = ({ config, treeResponseFactory }) => { - const integrations = ScmIntegrations.fromConfig(config); - const integrationsConfig = integrations.byHost('myCustomDomain') ?? {}; - const reader = new CustomUrlReader(integrationsConfig); + const reader = new CustomUrlReader(config); const predicate = (url: URL) => url.host === 'myCustomDomain'; return [{ reader, predicate }]; }; - constructor(private readonly integrationConfig: CustomIntegrationConfig) {} + constructor(private readonly config: Config) {} // implementations of read, readTree and search methods skipped for this example }