ConfigLoader

View as MarkdownOpen in Claude

ConfigLoader loads JSON configuration files and substitutes environment variables using ${VAR|default} syntax. It is used internally by SecurityConfig and the mcp-gateway service, and can be used directly for custom configuration needs.

from signalwire.core.config_loader import ConfigLoader

Properties

config_paths
list[str]

List of file paths checked during initialization. The first existing file is loaded.

Methods

Example

from signalwire.core.config_loader import ConfigLoader
# Auto-discover config file
loader = ConfigLoader()
print(f"Config loaded: {loader.has_config()}")
# Explicit config file path
loader = ConfigLoader(["./my-config.json", "/etc/myapp/config.json"])
print(f"Config file: {loader.get_config_file()}")