diff --git a/index.html b/index.html index e328fe7..e087617 100644 --- a/index.html +++ b/index.html @@ -7,20 +7,18 @@ - -

+

There have been no views of this page

user

- + diff --git a/src/main.rs b/src/main.rs index 8760dd7..67900ba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,7 +83,12 @@ async fn register_hit( tx.commit().await.unwrap_or_default(); } - "".to_string() + let hits = sqlx::query_scalar!("select count(*) from hits where page = ?", slug) + .fetch_one(&db) + .await + .unwrap_or(1); + + format!("{hits}") } #[axum::debug_handler] diff --git a/user/index.html b/user/index.html index b1efa83..421ee5a 100644 --- a/user/index.html +++ b/user/index.html @@ -7,19 +7,17 @@ - -

+

oy, guv, there've been no hits, mate.

- +