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.

1from 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

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