panic on start if env vars are not set

This commit is contained in:
Daniel Maslowski 2025-01-20 21:55:22 +01:00
parent 6cab009b3a
commit fab52f7f80

View File

@ -17,6 +17,13 @@ const STATUS_FILE: &str = "status.json";
#[tokio::main] #[tokio::main]
async fn 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() let app = Router::new()
.route("/status.json", get(root)) .route("/status.json", get(root))
.route("/api/update", post(the_doors)); .route("/api/update", post(the_doors));