feat!: add health endpoint
This commit is contained in:
parent
d82dbfdd43
commit
de3e738445
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue