mirror of
https://github.com/creating2morrow/neveko.git
synced 2024-12-22 19:49:24 +00:00
revert i2p status check back to json
This commit is contained in:
parent
d00a0be810
commit
ba0c50c170
2 changed files with 8 additions and 2 deletions
|
@ -137,6 +137,7 @@ fn get_i2p_proxy_port() -> String {
|
|||
let port = v.remove(2);
|
||||
port
|
||||
}
|
||||
|
||||
/// Create the http proxy if it doesn't exist
|
||||
fn create_http_proxy() {
|
||||
let args = args::Args::parse();
|
||||
|
|
|
@ -34,8 +34,13 @@ pub async fn get_version(_jwp: proof::PaymentProof) -> Custom<Json<reqres::XmrRp
|
|||
///
|
||||
/// This also functions as a health check
|
||||
#[get("/status")]
|
||||
pub async fn get_i2p_status() -> Custom<Json<i2p::ProxyStatus>> {
|
||||
Custom(Status::Ok, Json(i2p::check_connection().await))
|
||||
pub async fn get_i2p_status() -> Custom<Json<i2p::HttpProxyStatus>> {
|
||||
let status: i2p::ProxyStatus = i2p::check_connection().await;
|
||||
if status == i2p::ProxyStatus::Open {
|
||||
Custom(Status::Ok, Json(i2p::HttpProxyStatus { open: true }))
|
||||
} else {
|
||||
Custom(Status::Ok, Json(i2p::HttpProxyStatus { open: false }))
|
||||
}
|
||||
}
|
||||
|
||||
/// Share your contact information
|
||||
|
|
Loading…
Reference in a new issue