chore: add apps as option

This commit is contained in:
Jesús Pérez Lorenzo 2021-10-12 11:13:16 +01:00
parent 80810d30a6
commit 56695fc2dd

View File

@ -50,6 +50,9 @@ pub async fn cloud_req(reqname: &str,cloud: &Cloud,reqenv: &ReqEnv,opts: &KloudQ
"liveness" => {
result.to_owned()
},
"apps" => {
result.to_owned()
},
_ => {
result.to_owned()
}
@ -273,25 +276,26 @@ pub async fn status (
prfx: String,
// path: warp::path::FullPath, headers: warp::http::HeaderMap
) -> Result<impl Reply, Rejection> {
// dbg!("{:#?}",&db);
// dbg!("{:#?}",&db);
// dbg!("{:#?}",&header);
// dbg!("{:#?}",&opts);
// dbg!("{:#?}",&opts);
let reqenv = ReqEnv::new(db.app, db.auth, header, method, "/status", "status", &prfx);
// if let Some(lang_str) = header.get("accept-language") {
// println!("{:?}",&lang_str);
// }
// println!("User: {} | {}",&user.user_id,&user.token);
println!("Status prfx: {}",&prfx);
// println!("LANG: {}",language);
// if prfx.as_str() == "prfl" {
// let cur = db.colls.ta.entries.read();
// }
// let allow_origin = reqenv.websrvr().allow_origin;
// let result = cloud_req("status",&cloud,&reqenv,&opts).await;
// let result = cloud_req("status",&cloud,&reqenv,&opts).await;
// println!("Result: {}",&result);
// return Ok(warp::http::Response::builder()
// .body(result.to_string())
// .into_response());
// .body(result.to_string())
// .into_response());
match reqenv.user_authentication().await {
Ok(_auth) => {
// dbg!("auth: {}",&auth);