Skip to content

Commit

Permalink
app-backend: separate config injection handling for protected and pub…
Browse files Browse the repository at this point in the history
…lic bundle

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
  • Loading branch information
Rugvip committed Apr 9, 2024
1 parent 37973c2 commit ed4e394
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions plugins/app-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,6 @@ export async function createRouter(

logger.info(`Serving static app content from ${appDistDir}`);

let injectedConfigPath: string | undefined;
if (!disableConfigInjection) {
const appConfigs = await readConfigs({
config,
appDistDir,
env: process.env,
schema: options.schema,
});

injectedConfigPath = await injectConfig({ appConfigs, logger, staticDir });
}
const appConfigs = disableConfigInjection
? undefined
: await readConfigs({
Expand Down Expand Up @@ -245,7 +234,6 @@ export async function createRouter(
assetStore,
staticFallbackHandler,
appConfigs,
injectedConfigPath,
}),
);

Expand Down Expand Up @@ -281,21 +269,18 @@ async function createEntryPointRouter({
staticFallbackHandler,
appMode,
appConfigs,
injectedConfigPath,
}: {
logger: Logger;
rootDir: string;
assetStore?: StaticAssetsStore;
staticFallbackHandler?: express.Handler;
appMode: 'public' | 'protected';
appConfigs?: AppConfig[];
injectedConfigPath?: string;
}) {
const staticDir = resolvePath(rootDir, 'static');

if (appConfigs) {
await injectConfig({ appConfigs, logger, staticDir });
}
const injectedConfigPath =
appConfigs && (await injectConfig({ appConfigs, logger, staticDir }));

await injectAppMode({ appMode, rootDir });

Expand Down

0 comments on commit ed4e394

Please sign in to comment.