refactor: re-structure frontend code

This commit is contained in:
Alexander Navarro 2025-02-19 12:44:09 -03:00
parent 6b7642b693
commit 3e0dd79217
11 changed files with 101 additions and 7 deletions

View file

@ -1,11 +1,14 @@
use axum::{extract::State, response::Html, routing::get, Router};
use minijinja::context;
use std::sync::Arc;
use tower_http::services::ServeDir;
use crate::{AppState, ResultTemplate};
pub fn new() -> Router<Arc<AppState>> {
Router::new().route("/", get(handler_home))
Router::new()
.route("/", get(handler_home))
.nest_service("/assets", ServeDir::new("dist/assets"))
}
async fn handler_home(State(state): State<Arc<AppState>>) -> ResultTemplate {