-
Notifications
You must be signed in to change notification settings - Fork 100
Configuration
KiraLT edited this page Nov 2, 2021
·
6 revisions
You can pass JSON config file to any run command with -c
option (e.g. npm run start -c config.json
).
All config parameters are optional, so you add only necessary parameters to your configurations.
Config uses common-stuff/convertToNested parser, so you can specify any parameter from config by passing the ENV variable with config
prefix (separate different levels with __
).
You can also pass JSON values for these ENV variables. Keys are automatically converted to camelCase.
-
CONFIG='{"port": 80}'
- overwrite port by passing JSON config -
CONFIG__PORT='80'
- overwrite port by providing exact parameter -
CONFIG__LOGGING__TRANSPORTS='[{"type": "loggly", "subdomain": "loggly-subdomain", "token": "my token"}]'
- add loggly logging
Some config parameters have ENV variable shortcuts:
Env Variable | Shortcut to |
---|---|
HOST |
CONFIG__HOST |
PORT |
CONFIG__PORT |
API_KEY |
CONFIG__SECURITY__API_KEY |
NODE_ENV |
CONFIG__ENVIRONMENT |
TRUST_PROXY |
CONFIG__TRUST_PROXY |