Files
Krys4lide/crates/app/src/templates/hello.rs

21 lines
396 B
Rust
Raw Normal View History

use askama::Template;
2024-08-04 18:34:42 +02:00
use askama_axum::IntoResponse;
use axum::{routing, Router};
#[derive(Template)]
#[template(path = "hello.html")]
2024-08-04 18:34:42 +02:00
struct HelloResponse {
pub name: String,
}
2024-08-04 18:34:42 +02:00
async fn hello() -> impl IntoResponse {
HelloResponse {
name: "Theo".to_string(),
}.into_response()
}
pub fn get_routes() -> Router {
Router::new()
.route("/", routing::get(hello))
}