Split into libs
This commit is contained in:
28
identity/src/lib.rs
Normal file
28
identity/src/lib.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user