brane_api/
health.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* TIM */

/* HEALTH.rs
 *   by Lut99
 *
 * Created:
 *   12 Jan 2022, 13:29:01
 * Last edited:
 *   08 May 2022, 14:40:04
 * Auto updated?
 *   Yes
 *
 * Description:
 *   Contains code for the health part of the brane API.
**/

use warp::http::HeaderValue;
use warp::hyper::Body;
use warp::reply::Response;
use warp::{Rejection, Reply};


pub async fn handle() -> Result<impl Reply, Rejection> {
    let mut response = Response::new(Body::from("OK!\n"));

    response.headers_mut().insert("Content-Length", HeaderValue::from(4));

    Ok(response)
}

/*******/