ConfigBase
Extends:
Direct Subclass:
Indirect Subclass:
Base Config Object
Supports classes with a single argument "options"
These will be sorted into a member called "this.config" containing all the same keys
Crucially, these can also be overriden through environment variables
For example, for a config option "timeout" for class Database, this could be overriden through either:
env.TPAPI_TIMEOUT (using a "global module name")
Classes can also add additional prefixes to the supported environment variables through:
new ClassInstance({configPrefixes: ['myCustomPrefix']});
Which would also allow env.MYCUSTOMPREFIX_TIMEOUT to be used
Note that a default value must be supplied for the environment variable to be processed
If the default value is a number, the environment variable will be cast to a number as well
Constructor Summary
Public Constructor | ||
public |
constructor(options: object) A base class that can be configured through environment variables |
Member Summary
Public Members | ||
public |
config: * Parse the config of a specific park as object |