From 19f2dbd3a0324c091d5856cf8dcbc99f5b7186c0 Mon Sep 17 00:00:00 2001 From: structix Date: Sat, 21 Mar 2026 22:28:23 +0100 Subject: [PATCH] Update routes and add index.html --- src/http_server.rs | 8 ++-- static/index.html | 96 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 static/index.html diff --git a/src/http_server.rs b/src/http_server.rs index 6b10065..f4157cc 100644 --- a/src/http_server.rs +++ b/src/http_server.rs @@ -35,10 +35,10 @@ pub async fn http_serve(database: &Database, mpris_producer: Sender<(String, Str .fallback_service(ServeDir::new("static")) .route("/stats", get(get_stats)) .route("/", get(root)) - .route("/rating/:rating", get(cache_rating_only)) - .route("/userid/:user_id", get(add_userid)) - .route("/usercard/:user_card", get(add_userid_by_card)) - .route("/:user_id/:rating", get(add_rating)) + .route("/rating/{rating}", get(cache_rating_only)) + .route("/userid/{user_id}", get(add_userid)) + .route("/usercard/{user_card}", get(add_userid_by_card)) + .route("/{user_id}/{rating}", get(add_rating)) .with_state(shared_state); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..b706656 --- /dev/null +++ b/static/index.html @@ -0,0 +1,96 @@ + + + + + + Live Music Ratings + + + + +
+

🎵 Live Leaderboard

+ +
+ +
+ +
+ + + + + + + + + + + +
ListenerTracks RatedAverage Rating
Loading live stats...
+
+
+ + + +