mirror of
https://github.com/creating2morrow/neveko.git
synced 2025-01-18 16:54:38 +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);
|
let port = v.remove(2);
|
||||||
port
|
port
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create the http proxy if it doesn't exist
|
/// Create the http proxy if it doesn't exist
|
||||||
fn create_http_proxy() {
|
fn create_http_proxy() {
|
||||||
let args = args::Args::parse();
|
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
|
/// This also functions as a health check
|
||||||
#[get("/status")]
|
#[get("/status")]
|
||||||
pub async fn get_i2p_status() -> Custom<Json<i2p::ProxyStatus>> {
|
pub async fn get_i2p_status() -> Custom<Json<i2p::HttpProxyStatus>> {
|
||||||
Custom(Status::Ok, Json(i2p::check_connection().await))
|
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
|
/// Share your contact information
|
||||||
|
|
Loading…
Reference in a new issue