Customize the express server configuration: For example to add custom routes
Example:
const newRouteCustomizer = (express: exp.Express, ...handlers: exp.RequestHandler[]) => { express.get("/new-route", ...handlers, (req, res) => { res.json({ key: "value" }); }); }
Default set of regular expressions used to remove sensitive information from messages and logs. The entries are applied in order, so more specific regular expressions should be placed earlier in the list to avoid a shorter replacement preventing a longer replacement from being applied.
Log the loading of a configuration
name of configuration source
Exposes the configuration for lookup of configuration values. This is useful for components to obtain values eg. from configuration.custom like user provided secrets etc.
the property path evaluated against the configuration instance
Overwrite values in the former configuration with values in the latter. The start object is modified. Arrays are concatenated.
starting configuration
resulting merged configuration
Generate defaults for various configuration option values. These
will only be used if values are not provided by any source. Values
not provided here will be undefined
.
default configuration
Read and return user config from UserConfigFile.
Invoke postProcessors on the provided configuration.
Load configuration from the ATOMIST_CONFIG environment variable, if it the variable is defined, and merge it into the passed in configuration. The value of the ATOMIST_CONFIG environment variable should be serialized JSON of AutomationServerOptions. The values from the environment variable will override values in the passed in configuration. If the environment variable is not defined, the passed in configuration is returned unchanged.
automation server options
Load configuration from the file defined by the ATOMIST_CONFIG_PATH environment variable, if it the variable is defined and the file exists, and return it. The contents of the ATOMIST_CONFIG_PATH file should be serialized JSON of AutomationServerOptions. If the environment variable is not defined or the file path specified by its value cannot be read as JSON, an empty object is returned.
automation server options
Load the automation configuration from the configuration object exported from cfgPath and return it. If no configuration path is provided, the package will be searched for a file named atomist.config.js. If no atomist.config.js is found, an empty object is returned. If more than one is found, an exception is thrown.
automation configuration or undefined
Load and populate the automation configuration. The configuration is loaded from several locations with the following precedence from highest to lowest.
ATOMIST_
environment variables, see resolveEnvironmentVariablesconfiguration
from those filesIf any of the sources are missing, they are ignored. Any truthy configuration values specified by sources of higher precedence cause any values provided by sources of lower precedence to be ignored. Arrays are replaced, not merged. Typically the only required values in the configuration for a successful registration are the apiKey and non-empty workspaceIds.
Placeholder of the form ${ENV_VARIABLE}
in string configuration
values will get resolved against the environment. The resolution
happens after all of the above configuration sources have been
merged.
After all sources are merged and the resulting configuration processed for placeholders and environment variables, the configuration is validated using validateConfiguration.
The configuration exported from the index.js (or atomist.config.js) is modified to contain the final configuration values and returned from this function.
path to file exporting the configuration object, if not provided the package is searched for one
merged configuration object
Return the default configuration based on NODE_ENV or ATOMIST_ENV. ATOMIST_ENV takes precedence if it is set.
Load the automation configuration from the configuration objects exported and merged by all index.js files in the automation client.
automation configuration
Try to read user config, overriding its values with a per-module configuration that matches this automation.
automation client package name to load as module config if it exists
automation client package version to load as module config if version satifies module config version range
module-specific config with user config supplying defaults
Overwrite values in the former configuration with values in the latter. The start object is modified.
starting configuration
resulting merged configuration
Resolve ATOMIST_ environment variables and add them to config. Variables of like ATOMIST_custom_foo_bar will be converted to a json path of custom.foo.bar.
Merge a user's global and proper per-module configuration, if it exists. Values from the per-module configuration take precedence over the user-wide values. Per-module configuration is gotten from the first per-module configuration that matches name and, optionally, the version is within the per-module configuration's version range. A module configuration without a version range matches the named module with any version. If no version is provided, any version range is satisfied, meaning the first per-module configuration with a matching name is used. If no name is provide, only the user configuration is loaded. The first per-module match is used. This means if you have multiple configurations for the same named module and you want to include a default configuration for that module, put a configuration without a version range after all the configurations with version ranges. Note that only values from the first per-module match are used.
the user's configuration, which may include per-module configuration
automation client package name to load as module config if it exists
automation client package version to load as module config if version satifies module config version range
the merged module and user configuration
Resolve placeholders against the process.env. Placeholders should be of form ${ENV_VAR}. Placeholders support default values in case they aren't defined: ${ENV_VAR:default value}
Resolve the HTTP port from the environment and configuration. The PORT environment variable takes precedence over the config value.
Examine environment, config, and cfg for Atomist workspace IDs. The ATOMIST_WORKSPACES environment variable takes precedence over the config "workspaceIds", which takes precedence over cfg.workspaceId, which may be undefined, null, or an empty array.
current configuration, whose workspaceIds properties may be modified by this function
the resolved workspace IDs
Return Atomist user configuration directory.
Return user automation client configuration path.
Return user automation client configuration paths including such referenced by configuration profiles.
Make sure final configuration has the minimum configuration it needs. It will throw an error if required properties are missing.
final configuration
Write user config securely, creating directories as necessary.
Default configuration when running in neither testing or production.
Configuration defaults for production environments.
Configuration defaults for pre-production environments.
Generated using TypeDoc
Post process the configuration after is has been merged from the various locations, but before starting the automation client.