Appearance
Environment Configuration
JSON Configuration Files
The framework loads configuration from JSON files. You can have different files for each environment:
config/
├── development.json
├── staging.json
└── production.jsonConfiguration Precedence
When multiple sources provide a value, the precedence is:
- Command-line flags — highest priority, override everything.
- JSON config file — loaded via
--configorconfig.load_from_json(). - Code defaults — the
configurationstruct's default values (lowest priority).
bash
# CLI flags always win over JSON
./node --config config/production.json --port 9090 # port will be 9090, not what's in JSONConfiguration Overrides
Command-line arguments can override JSON config values:
bash
./node --config config/production.json --port 8080 --node-port 10001Environment-Specific Settings
Development
json
{
"ports": { "node_port": 10000, "client_port": 8080 },
"logging": { "scopes": ["service", "operational", "verbose"] },
"quotas": { "enabled": false },
"wal": { "enabled": false }
}Production
json
{
"ports": { "node_port": 10000, "client_port": 8080 },
"logging": { "scopes": ["service", "operational"] },
"tls": {
"cert_chain_file": "/etc/ssl/certs/server.crt",
"private_key_file": "/etc/ssl/private/server.key"
},
"quotas": { "enabled": true },
"wal": { "enabled": true }
}Secrets Management
JWT keys and TLS certificates should never be hardcoded. Use environment variables or a secrets manager to inject them at runtime.