about summary refs log tree commit diff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index ce654df..1b333a2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,7 @@
+use kittybox_micropub as micropub;
+use log::{debug, error, info};
 use std::env;
-use log::{error,info,debug};
 use surf::Url;
-use kittybox_micropub as micropub;
 
 #[async_std::main]
 async fn main() -> Result<(), std::io::Error> {
@@ -16,7 +16,7 @@ async fn main() -> Result<(), std::io::Error> {
         Ok(val) => {
             debug!("Redis connection: {}", val);
             redis_uri = val
-        },
+        }
         Err(_) => {
             error!("REDIS_URI is not set, cannot find a database");
             std::process::exit(1);
@@ -50,7 +50,7 @@ async fn main() -> Result<(), std::io::Error> {
                     std::process::exit(1)
                 }
             }
-        },
+        }
         Err(_) => {
             error!("AUTHORIZATION_ENDPOINT is not set, will not be able to confirm token and ID requests using IndieAuth!");
             std::process::exit(1)
@@ -59,7 +59,15 @@ async fn main() -> Result<(), std::io::Error> {
 
     let media_endpoint: Option<String> = env::var("MEDIA_ENDPOINT").ok();
 
-    let host = env::var("SERVE_AT").ok().unwrap_or_else(|| "0.0.0.0:8080".to_string());
-    let app = micropub::get_app_with_redis(token_endpoint, authorization_endpoint, redis_uri, media_endpoint).await;
+    let host = env::var("SERVE_AT")
+        .ok()
+        .unwrap_or_else(|| "0.0.0.0:8080".to_string());
+    let app = micropub::get_app_with_redis(
+        token_endpoint,
+        authorization_endpoint,
+        redis_uri,
+        media_endpoint,
+    )
+    .await;
     app.listen(host).await
 }