25 lines
580 B
Rust
25 lines
580 B
Rust
|
|
mod response;
|
||
|
|
mod iam;
|
||
|
|
|
||
|
|
use axum::{routing::get, Json, Router};
|
||
|
|
use response::SigmaInformation;
|
||
|
|
use tracing::instrument;
|
||
|
|
|
||
|
|
#[allow(unused)]
|
||
|
|
use log::{info, debug, warn, error, trace};
|
||
|
|
|
||
|
|
const NAME: &str = "TinySigma";
|
||
|
|
const VERSION: &str = "0.0.2.1";
|
||
|
|
|
||
|
|
pub fn router() -> Router {
|
||
|
|
info!("Loading {NAME} app routes");
|
||
|
|
debug!("TinySigma version is {}", VERSION);
|
||
|
|
Router::new()
|
||
|
|
.route("/", get(information))
|
||
|
|
.nest("/identity", iam::router())
|
||
|
|
}
|
||
|
|
|
||
|
|
#[instrument]
|
||
|
|
async fn information() -> Json<SigmaInformation> {
|
||
|
|
Json(SigmaInformation::new(NAME, VERSION))
|
||
|
|
}
|