fix: change project naming, create dummy sesame-vitale project

This commit is contained in:
theo
2024-07-24 21:59:24 +02:00
parent ff2c84fb33
commit 7d41fbb519
37 changed files with 56 additions and 31 deletions

27
crates/app/src/lib.rs Normal file
View File

@ -0,0 +1,27 @@
mod templates;
use std::path::Path;
use askama_axum::IntoResponse;
use templates::{hello::HelloResponse, index::GetIndexResponse};
use tower_http::services::ServeDir;
async fn root() -> impl IntoResponse {
return GetIndexResponse {}.into_response();
}
async fn hello() -> impl IntoResponse {
return HelloResponse {
name: "Theo".to_string(),
}
.into_response();
}
pub fn get_router(assets_path: &Path) -> axum::Router {
let router = axum::Router::new()
.nest_service("/assets", ServeDir::new(assets_path))
.route("/", axum::routing::get(root))
.route("/hello", axum::routing::get(hello));
router
}