summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-08-23 22:19:32 +0200
committerSanto Cariotti <santo@dcariotti.me>2024-08-23 22:19:32 +0200
commit7b9e9d2da5d85f23d43724fe2ca5012918ea54be (patch)
tree801ccae65d27fcf69bfca5db18265fbb7b5d7f21 /src/config.rs
parentcb1aa9668a967fe875e716469ccf936ed8693ad3 (diff)
Add doc
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs9
1 files changed, 9 insertions, 0 deletions
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<Self, ConfigError> {
let builder = config::Config::builder().add_source(config::Environment::default());