mirror of
https://github.com/Noratrieb/killjoy-turret.git
synced 2026-01-14 14:45:01 +01:00
read config path from env
This commit is contained in:
parent
ea2ae4ddcb
commit
85e29a3ae1
1 changed files with 3 additions and 1 deletions
|
|
@ -25,7 +25,9 @@ impl EventHandler for Handler {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let file = fs::read_to_string("config.json").unwrap();
|
||||
let file_path = std::env::var("CONFIG_PATH").unwrap_or("./config.json");
|
||||
println!("reading config from {file_path}");
|
||||
let file = fs::read_to_string(file_path).unwrap();
|
||||
let config = serde_json::from_str::<ConfigFile>(&file).unwrap();
|
||||
|
||||
let token = &config.token;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue