From f41f0d116ff5ac9cd23752d634a3173a90bfeb01 Mon Sep 17 00:00:00 2001 From: Mauricio Martinez Date: Wed, 8 Nov 2023 11:58:43 -0600 Subject: [PATCH] Fix build of backend plugin --- packages/form-data-backend/src/service/router.test.ts | 6 ++++++ packages/form-data-backend/src/service/standaloneServer.ts | 4 +++- yarn.lock | 5 ----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/form-data-backend/src/service/router.test.ts b/packages/form-data-backend/src/service/router.test.ts index 64bdd90..0173084 100644 --- a/packages/form-data-backend/src/service/router.test.ts +++ b/packages/form-data-backend/src/service/router.test.ts @@ -1,4 +1,5 @@ import { getVoidLogger } from '@backstage/backend-common'; +import { ConfigReader } from '@backstage/config'; import express from 'express'; import request from 'supertest'; import { exampleRouter } from '../providers'; @@ -12,6 +13,11 @@ describe('createRouter', () => { const router = await createRouter( { logger: getVoidLogger(), + config: new ConfigReader({ + app: { + baseUrl: 'http://example.com/extra-path', + }, + }), }, [ { diff --git a/packages/form-data-backend/src/service/standaloneServer.ts b/packages/form-data-backend/src/service/standaloneServer.ts index 5ddb9ae..d11d4ce 100644 --- a/packages/form-data-backend/src/service/standaloneServer.ts +++ b/packages/form-data-backend/src/service/standaloneServer.ts @@ -1,4 +1,4 @@ -import { createServiceBuilder } from '@backstage/backend-common'; +import { createServiceBuilder, loadBackendConfig } from '@backstage/backend-common'; import { Server } from 'http'; import { Logger } from 'winston'; import { exampleRouter } from '../providers'; @@ -14,10 +14,12 @@ export async function startStandaloneServer( options: ServerOptions, ): Promise { const logger = options.logger.child({ service: 'form-data-backend' }); + const config = await loadBackendConfig({ logger, argv: process.argv }); logger.debug('Starting application server...'); const router = await createRouter( { logger, + config, }, [ { diff --git a/yarn.lock b/yarn.lock index c575836..4aed3f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16868,11 +16868,6 @@ zod-to-json-schema@~3.18.0: resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.18.2.tgz#ce540062c6b57e5cc170aae57dad5eeb76d64f7b" integrity sha512-Vv1emSad6nJGRJUD/cdVxSgxtT3PnaUiHHZ+PxDU5vx+klM9eDekuIj6lO+tZTbATK+6ktJfY2C+WXn2mMX3Jw== -zod@^3.18.0: - version "3.22.2" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.2.tgz#3add8c682b7077c05ac6f979fea6998b573e157b" - integrity sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg== - zod@~3.18.0: version "3.18.0" resolved "https://registry.yarnpkg.com/zod/-/zod-3.18.0.tgz#2eed58b3cafb8d9a67aa2fee69279702f584f3bc"