use torrust_tracker_configuration::{Configuration, Info};
const ENV_VAR_CONFIG: &str = "TORRUST_TRACKER_CONFIG";
const ENV_VAR_API_ADMIN_TOKEN: &str = "TORRUST_TRACKER_API_ADMIN_TOKEN";
pub const ENV_VAR_PATH_CONFIG: &str = "TORRUST_TRACKER_PATH_CONFIG";
pub const DEFAULT_PATH_CONFIG: &str = "./share/default/config/tracker.development.sqlite3.toml";
#[must_use]
pub fn initialize_configuration() -> Configuration {
let info = Info::new(
ENV_VAR_CONFIG.to_string(),
ENV_VAR_PATH_CONFIG.to_string(),
DEFAULT_PATH_CONFIG.to_string(),
ENV_VAR_API_ADMIN_TOKEN.to_string(),
)
.unwrap();
Configuration::load(&info).unwrap()
}
#[cfg(test)]
mod tests {
#[test]
fn it_should_load_with_default_config() {
use crate::bootstrap::config::initialize_configuration;
drop(initialize_configuration());
}
}