diff --git a/src/server.rs b/src/server.rs index c81ba1d..1564017 100644 --- a/src/server.rs +++ b/src/server.rs @@ -14,9 +14,9 @@ use tokio::sync::Mutex; use axum:: { - routing::post, + routing::{post, get}, Router, - middleware + middleware, response::Redirect }; use axum_server::tls_rustls::RustlsConfig; @@ -58,6 +58,7 @@ impl Server .route("/", post(|| async move { })) .layer(middleware::from_fn_with_state(github, filter_github)) .layer(middleware::from_fn_with_state(throttle_state.clone(), handle_throttle)) + .route("/badge", get(|| async move {Redirect::permanent("https://badgen.net/badge/Pulse/live/green?icon=discord")})) } } diff --git a/src/server_http.rs b/src/server_http.rs index dd17901..a0b315a 100644 --- a/src/server_http.rs +++ b/src/server_http.rs @@ -13,8 +13,9 @@ use tokio::sync::Mutex; use axum:: { - routing::post, + routing::{post, get}, Router, + response::Redirect, middleware }; @@ -56,6 +57,7 @@ impl ServerHttp .route("/", post(|| async move { })) .layer(middleware::from_fn_with_state(github, filter_github)) .layer(middleware::from_fn_with_state(throttle_state.clone(), handle_throttle)) + .route("/badge", get(|| async move {Redirect::permanent("https://badgen.net/badge/Pulse/live/green?icon=discord")})) } }