feat: more in depth statuses
This commit is contained in:
parent
8d2a69c366
commit
4decadebfa
3 changed files with 53 additions and 6 deletions
14
src/relay.rs
14
src/relay.rs
|
@ -27,10 +27,24 @@ pub async fn get_hub_issues() -> HttpResponse {
|
|||
.body(status_response.text().await.unwrap())
|
||||
}
|
||||
|
||||
#[get("/hub_issue_timeline/{issue_id}")]
|
||||
pub async fn get_hub_issue_timeline(info: web::Path<(u32,)>) -> HttpResponse {
|
||||
let status_response = if let Ok(res) = reqwest::get(format!("https://git.ixvd.net/api/v1/repos/ixvd/hub/issues/{}/timeline", info.into_inner().0)).await {
|
||||
res
|
||||
} else {
|
||||
return HttpResponse::build(StatusCode::INTERNAL_SERVER_ERROR)
|
||||
.body("Failed to get status from forgejo");
|
||||
};
|
||||
|
||||
HttpResponse::build(StatusCode::OK)
|
||||
.body(status_response.text().await.unwrap())
|
||||
}
|
||||
|
||||
pub fn configure(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(
|
||||
web::scope("/relay")
|
||||
.service(get_gatus_services)
|
||||
.service(get_hub_issues)
|
||||
.service(get_hub_issue_timeline)
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue