use axum::{extract::State, routing::get, Json, Router};
use std::env;
use tokio::runtime::Runtime;
use tonic::transport::Endpoint;

#[derive(Clone)]
struct AppState {
    state: Vec<String>,
}

async fn http_handler(State(app): State<AppState>) -> Json<String> {
    let token = env::var("API_TOKEN").unwrap();
    let _router = Router::new().route("/ready", get(|| async {}));
    let _channel = Endpoint::from_static("http://127.0.0.1:50051")
        .connect()
        .await
        .unwrap();

    let values = vec![1, 2, 3];
    for _value in values {
        let _copied = app.state.clone();
    }

    Json(token)
}

fn build_client(app: AppState) -> usize {
    let runtime = Runtime::new().unwrap();
    let _ = runtime;
    app.state.len()
}
