Skip to content

Commit

Permalink
Bots: redirect for homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Feb 24, 2025
1 parent 819b412 commit a91436c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/perps-exes/src/bin/perps-bots/endpoints/common.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
pub(crate) async fn homepage() -> &'static str {
r#"Welcome intrepid reader!
use axum::response::{IntoResponse, Response};
use http::{header::LOCATION, HeaderValue, StatusCode};

pub(crate) async fn homepage() -> Response {
let mut res = r#"Welcome intrepid reader!
Not sure what you thought you'd find, but you didn't find it.
Better luck next time."#
.into_response();
*res.status_mut() = StatusCode::FOUND;
res.headers_mut()
.insert(LOCATION, HeaderValue::from_static("/status"));
res
}

pub(crate) async fn healthz() -> &'static str {
Expand Down

0 comments on commit a91436c

Please sign in to comment.