Skip to content

Commit 729bf58

Browse files
committed
Add the ability to prefix env var name with SQLPAGE_
Fixes #44
1 parent fdaaf4b commit 729bf58

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ All the parameters above can be set through environment variables.
2323
The name of the environment variable is the same as the name of the configuration variable,
2424
but in uppercase.
2525

26+
The environment variable name can optionally be prefixed with `SQLPAGE_`.
27+
2628
### Example
2729

2830
```bash

src/app_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub fn load() -> anyhow::Result<AppConfig> {
3434
.set_default("listen_on", "0.0.0.0:8080")?
3535
.add_source(config::File::with_name("sqlpage/sqlpage").required(false))
3636
.add_source(env_config())
37+
.add_source(env_config().prefix("SQLPAGE_"))
3738
.build()?
3839
.try_deserialize::<AppConfig>()
3940
.with_context(|| "Unable to load configuration")?;

0 commit comments

Comments
 (0)