panic on start if env vars are not set
This commit is contained in:
parent
6cab009b3a
commit
fab52f7f80
@ -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));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user