Cleaned up directory, created documentation and readme
This commit is contained in:
parent
8a70db9b42
commit
d6aee1e99d
16 changed files with 71 additions and 2 deletions
12
site/src/config.rs
Normal file
12
site/src/config.rs
Normal 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);
|
||||
}
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue