added backend config to startFrontend. set cert key visibility to secret.

Signed-off-by: Luka Siric <siric.luka@gmail.com>
This commit is contained in:
Luka Siric
2022-08-29 12:30:48 +02:00
parent 09a17a82b3
commit 08eb42afdc
4 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ export async function serveBundle(options: ServeOptions) {
cert: options.frontendConfig.getOptionalString(
'app.https.certificate.cert',
),
key: options.frontendConfig.getOptionalString(
key: options.backendConfig.getOptionalString(
'app.https.certificate.key',
),
}
+2
View File
@@ -31,6 +31,8 @@ export type ServeOptions = BundlingPathsOptions & {
checksEnabled: boolean;
frontendConfig: Config;
frontendAppConfigs: AppConfig[];
backendConfig: Config;
backendAppConfigs: AppConfig[];
};
export type BuildOptions = BundlingPathsOptions & {
+9
View File
@@ -96,11 +96,20 @@ export async function loadCliConfig(options: Options) {
});
const frontendConfig = ConfigReader.fromConfigs(frontendAppConfigs);
const backendAppConfigs = schema.process(appConfigs, {
visibility: ['frontend', 'backend', 'secret'],
withFilteredKeys: options.withFilteredKeys,
withDeprecatedKeys: options.withDeprecatedKeys,
});
const backendConfig = ConfigReader.fromConfigs(backendAppConfigs);
return {
schema,
appConfigs,
frontendConfig,
frontendAppConfigs,
backendAppConfigs,
backendConfig,
};
} catch (error) {
const maybeSchemaError = error as Error & { messages?: string[] };
+1 -1
View File
@@ -75,7 +75,7 @@ export interface Config {
certificate?: {
/**
* Https Certificate private key. Use $file to load in a file
* @visibility frontend
* @visibility secret
*/
key?: string;
/**