From fab52f7f807f815ed89474ba37a879c5cc0d06d3 Mon Sep 17 00:00:00 2001 From: Daniel Maslowski Date: Mon, 20 Jan 2025 21:55:22 +0100 Subject: [PATCH] panic on start if env vars are not set --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index ef18a72..6b177db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,13 @@ const STATUS_FILE: &str = "status.json"; #[tokio::main] async fn main() { + if env::var("consumer_key").is_err() { + panic!("env var consumer_key must be set"); + } + if env::var("consumer_secret").is_err() { + panic!("env var consumer_secret must be set"); + } + let app = Router::new() .route("/status.json", get(root)) .route("/api/update", post(the_doors));