use axum::{routing::get, Json, Router};
#[allow(unused)]
use log::{info, debug, warn, error, trace};
use sigma::repsonse::SigmaInformation;
use tracing::instrument;


const NAME: &str = "TinyIdentity";
const VERSION: &str = "0.0.0.1";

pub fn router() -> Router {
    info!("Loading {NAME} app routes");
    debug!("{NAME} version is {VERSION}");
    Router::new()
        .route("/", get(information))
        .route("/setup", get(dummy))
        .route("/me", get(dummy))
}

#[instrument]
async fn dummy() -> Json<()> {
    Json(())
}

#[instrument]
async fn information() -> Json<SigmaInformation> {
    Json(SigmaInformation::new(NAME, VERSION))
}