feat!: add health endpoint

This commit is contained in:
Moritz Böhme 2025-10-03 17:50:13 +02:00
parent d82dbfdd43
commit de3e738445
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9

View file

@ -118,7 +118,7 @@ async fn main() {
tracing_subscriber::fmt::init(); tracing_subscriber::fmt::init();
let client = Client::new(); let client = Client::new();
let path = warp::path!(String) let rss = warp::path!("rss" / String)
.and_then(move |url| { .and_then(move |url| {
let client = client.clone(); let client = client.clone();
async move { async move {
@ -130,5 +130,6 @@ async fn main() {
} }
}) })
.map(|reply| warp::reply::with_header(reply, "Content-Type", "application/rss+xml")); .map(|reply| warp::reply::with_header(reply, "Content-Type", "application/rss+xml"));
warp::serve(path).run(([0, 0, 0, 0], 3030)).await; let health = warp::path!("health").map(|| "Healthy");
warp::serve(rss.or(health)).run(([0, 0, 0, 0], 3030)).await;
} }