Split into libraries - further cleanup

This commit is contained in:
Nevernown 2025-11-15 10:55:29 +01:00
parent 3b70d26155
commit 966ad6809b
4 changed files with 2 additions and 48 deletions

View File

@ -1,28 +0,0 @@
use axum::{routing::get, Json, Router};
#[allow(unused)]
use log::{info, debug, warn, error, trace};
use tracing::instrument;
use super::response::SigmaInformation;
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))
}

View File

@ -1,8 +1,5 @@
mod response;
mod identity;
use axum::{routing::get, Json, Router}; use axum::{routing::get, Json, Router};
use response::SigmaInformation; use sigma::repsonse::SigmaInformation;
use tracing::instrument; use tracing::instrument;
#[allow(unused)] #[allow(unused)]

View File

@ -1,15 +0,0 @@
use serde::Serialize;
#[derive(Serialize)]
pub struct SigmaInformation {
name: String,
version: String,
}
impl SigmaInformation {
pub fn new(name: &str, version: &str) -> Self {
Self {
version: version.into(),
name: name.into()
}
}
}

View File

@ -1,4 +1,4 @@
pub enum Error { pub enum Error {
TcpBindFailed = 1, TcpBindFailed = 1,
AxumAppExited = 2, AxumAppExited,
} }