chore: scaffold axum server with in-memory CRUD, auth stub and tracing

This commit is contained in:
2026-04-19 16:03:04 +03:00
parent 132de93600
commit 90c9b9d6ff
10 changed files with 1756 additions and 13 deletions

View File

@@ -0,0 +1,25 @@
use axum::{Router, routing::get};
pub fn routes_health() -> Router {
Router::new().route("/health", get(health))
}
async fn health() -> &'static str {
"up"
}
#[cfg(test)]
mod tests {
use axum::{Router, routing::get};
use axum_test::TestServer;
use crate::web::routes_health::health;
#[tokio::test]
async fn test_route_health() {
let app = Router::new().route(&"/health", get(health));
let server = TestServer::new(app);
let response = server.get("/health").await;
response.assert_status_ok().assert_text("up");
}
}