Skip to main content

ServerConfigHelper

The ServerConfigHelper class offers functionality to work with configuration.

import { ServerConfigHelper } from '@archibald/server';

strip

This method strips app property from configuration.

import { ServerConfigHelper } from '@archibald/server';

const { app } = ServerConfigHelper.strip(PARAMETERS);

Parameters

NameTypeDescription
configClientConfigAn object holding the app property.

fillInWithSecrets

This method replaces placeholders {{ }} in the environment config files with secrets provided in environment variable(s).

import { ServerConfigHelper } from '@archibald/server';

const config = ServerConfigHelper.fillInWithSecrets(PARAMETERS);

Parameters

NameTypeDescriptionDefault
configClientConfig | ServerConfigAn object holding project configuration. Must contain the app property.
secretsSecrets | undefinedKey Value Pairs to substitute in Config.

prepareState

This method prepares head and body script tags.

import { ServerConfigHelper } from '@archibald/server';

const { head, body } = ServerConfigHelper.prepareState(PARAMETERS);

Parameters

NameTypeOptionalDescriptionDefault
configClientConfigAn object holding project configuration. Must contain the app property.
clientDataClient✔️DataClient instance.
cspNoncestring✔️An empty string.
compressboolean✔️true