mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-08-02 12:24:52 +02:00
config from env
This commit is contained in:
parent
e6d7f24e21
commit
652fd43f36
4 changed files with 56 additions and 3 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -79,8 +79,14 @@ async fn main() -> Result<()> {
|
|||
.try_init()
|
||||
.expect("Failed to init tracing");
|
||||
|
||||
let config = args().skip(1).next().expect("no config file provided");
|
||||
let config = Config::load(&config)?;
|
||||
let config = args()
|
||||
.skip(1)
|
||||
.next()
|
||||
.as_deref()
|
||||
.map(Config::load)
|
||||
.transpose()?
|
||||
.or_else(Config::env)
|
||||
.expect("no config file or env provided");
|
||||
let connection = config.database.connect().await?;
|
||||
|
||||
let session_store = MemoryStore::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue