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:
@@ -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',
|
||||
),
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ export type ServeOptions = BundlingPathsOptions & {
|
||||
checksEnabled: boolean;
|
||||
frontendConfig: Config;
|
||||
frontendAppConfigs: AppConfig[];
|
||||
backendConfig: Config;
|
||||
backendAppConfigs: AppConfig[];
|
||||
};
|
||||
|
||||
export type BuildOptions = BundlingPathsOptions & {
|
||||
|
||||
@@ -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[] };
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user