Cleaned up directory, created documentation and readme

This commit is contained in:
Leonard Lorenz 2020-10-23 00:20:26 +02:00
parent 8a70db9b42
commit d6aee1e99d
16 changed files with 71 additions and 2 deletions

12
site/src/config.rs Normal file
View file

@ -0,0 +1,12 @@
use std::string::String;
pub fn get_from_env(variable: &str, mandatory: bool) -> String {
std::env::var(variable).unwrap_or_else(|_| {
if mandatory {
println!("Error, couldn't read environment variable: {}", variable);
std::process::exit(1);
} else {
panic!("Error, couldn't read environment variable: {}", variable);
}
})
}