28 lines
566 B
Rust
28 lines
566 B
Rust
#[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(),
|
|
db_url: std::env::var("DATABASE_URL").expect("missing DATABASE_URL"),
|
|
}
|
|
}
|
|
}
|
|
|
|
pub struct ClientConfig {
|
|
pub upload_max_size: usize,
|
|
}
|
|
|
|
impl ClientConfig {
|
|
pub fn load() -> Self {
|
|
Self {
|
|
upload_max_size: 1024 * 1024 * 1024 * 1, //1GB for testing
|
|
}
|
|
}
|
|
}
|