diesel working

This commit is contained in:
2026-04-12 19:39:57 +02:00
parent 23ccd3f793
commit 5a37834d4e
8 changed files with 106 additions and 5 deletions

View File

@ -1,25 +1,27 @@
#[cfg(feature = "server")]
pub struct ServerConfig {
pub upload_folder: String,
pub db_url: String,
}
#[cfg(feature = "server")]
impl ServerConfig {
pub fn load() -> Self {
Self {
upload_folder: "./test/".to_string()
upload_folder: "./test/".to_string(),
db_url: std::env::var("DATABASE_URL").expect("missing DATABASE_URL"),
}
}
}
pub struct ClientConfig {
pub upload_max_size: usize
pub upload_max_size: usize,
}
impl ClientConfig {
pub fn load () -> Self {
pub fn load() -> Self {
Self {
upload_max_size: 1024 * 1024 * 1024 * 1 //1GB for testing
upload_max_size: 1024 * 1024 * 1024 * 1, //1GB for testing
}
}
}