summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-03-26 21:04:02 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-03-26 21:04:02 -0500
commitce961ca85ba96813ccdca9be1d18ee11e4e0d25c (patch)
tree4e368e35c275ea1be97473ae69aa052f4a0e98a2 /src/config.rs
parentfd1447999d9665866d65002b2c2317b8b150225f (diff)
feat: add user database and registration
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/config.rs b/src/config.rs
deleted file mode 100644
index dc132b8..0000000
--- a/src/config.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-#[derive(Debug, Default, Clone)]
-pub struct Config {
- pub database_url: String,
- pub jwt_secret: String,
- pub jwt_expires_in: String,
- pub jwt_maxage: i32,
-}
-
-impl Config {
- pub fn init() -> Config {
- let mut config = Config::default();
-
- if let Ok(database_url) = std::env::var("DATABASE_URL") {
- config.database_url = database_url;
- };
-
- if let Ok(jwt_secret) = std::env::var("JWT_SECRET") {
- config.jwt_secret = jwt_secret;
- };
-
- if let Ok(jwt_expires_in) = std::env::var("JWT_EXPIRED_IN") {
- config.jwt_expires_in = jwt_expires_in;
- };
-
- if let Ok(jwt_maxage) = std::env::var("JWT_MAXAGE") {
- config.jwt_maxage = jwt_maxage.parse::<i32>().unwrap();
- };
-
- config
- }
-}