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
| Name | Type | Description |
|---|---|---|
| config | ClientConfig | An 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
| Name | Type | Description | Default |
|---|---|---|---|
| config | ClientConfig | ServerConfig | An object holding project configuration. Must contain the app property. | |
| secrets | Secrets | undefined | Key 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
| Name | Type | Optional | Description | Default |
|---|---|---|---|---|
| config | ClientConfig | An object holding project configuration. Must contain the app property. | ||
| client | DataClient | ✔️ | DataClient instance. | |
| cspNonce | string | ✔️ | An empty string. | |
| compress | boolean | ✔️ | true |