blob: cffdc2f96fd6cb349d5a4dc69394ad5e41400c7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
use serde::{Deserialize, Serialize};
use std::{fs::File, path::PathBuf};
#[derive(Debug, Deserialize, Serialize, Default)]
pub struct GlobalConfig {
pub brand: String,
pub slogan: String,
pub asset_dir: PathBuf,
pub database_path: PathBuf,
pub library_path: PathBuf,
pub admin_username: String,
pub admin_password: String,
pub cookie_key: String,
}
pub fn load_global_config() -> GlobalConfig {
serde_json::from_reader(File::open("data/config.json").unwrap()).unwrap()
}
|