Skip to content

Commit

Permalink
adds badge generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerboa-app committed Jan 7, 2024
1 parent 721574d commit 104d9bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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")}))
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/server_http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ use tokio::sync::Mutex;

use axum::
{
routing::post,
routing::{post, get},
Router,
response::Redirect,
middleware
};

Expand Down Expand Up @@ -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")}))
}
}

Expand Down

0 comments on commit 104d9bf

Please sign in to comment.