about summary refs log tree commit diff
path: root/src/frontend/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mod.rs')
-rw-r--r--src/frontend/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs
index 0292171..42e8754 100644
--- a/src/frontend/mod.rs
+++ b/src/frontend/mod.rs
@@ -1,9 +1,8 @@
 use crate::database::{Storage, StorageError};
 use axum::{
-    extract::{Host, Path, Query},
+    extract::{Host, Query, State},
     http::{StatusCode, Uri},
     response::IntoResponse,
-    Extension,
 };
 use futures_util::FutureExt;
 use serde::Deserialize;
@@ -239,7 +238,7 @@ async fn get_post_from_database<S: Storage>(
 pub async fn homepage<D: Storage>(
     Host(host): Host,
     Query(query): Query<QueryParams>,
-    Extension(db): Extension<D>,
+    State(db): State<D>,
 ) -> impl IntoResponse {
     let user = None; // TODO authentication
     // This is stupid, but there is no other way.
@@ -333,7 +332,7 @@ pub async fn homepage<D: Storage>(
 
 #[tracing::instrument(skip(db))]
 pub async fn catchall<D: Storage>(
-    Extension(db): Extension<D>,
+    State(db): State<D>,
     Host(host): Host,
     Query(query): Query<QueryParams>,
     uri: Uri,