Given a set of environment variables and a prefix (default APP_CONFIG_):
- filter the ones whose name doesn't start with the prefix
- strip the prefix from the name of the remaining variables
- define the
window.APP_CONFIGobject using those key-value pairs
Example. Given the environment:
APP_CONFIG_KEY_0=VALUE_0
APP_CONFIG_KEY_1=VALUE_1
NON_PREFIXED_KEY=VALUEthe following window.APP_CONFIG is generated:
window.APP_CONFIG = {
KEY_0: "VALUE_0",
KEY_1: "VALUE_1"
};