From 7b9e9d2da5d85f23d43724fe2ca5012918ea54be Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Fri, 23 Aug 2024 22:19:32 +0200 Subject: Add doc --- src/config.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index cbea92e..7eefff8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -3,14 +3,23 @@ use lazy_static::lazy_static; use serde::Deserialize; #[derive(Deserialize)] +/// App config pub struct Configuration { + /// Level of Rust logging pub rust_log: String, + + /// Database URL for Postgres pub database_url: String, + + /// JWT secret used for key creation pub jwt_secret: String, + + /// Host URL pub allowed_host: String, } impl Configuration { + /// A new configuration read from the env pub fn new() -> Result { let builder = config::Config::builder().add_source(config::Environment::default()); -- cgit v1.2.3-18-g5258