mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-20 16:01:22 +02:00
tera wip
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
use axum::Extension;
|
||||
use tera::{Context, Tera};
|
||||
|
||||
use crate::error::ApiError;
|
||||
|
||||
pub async fn hello_world_handler(Extension(tera): Extension<Tera>) -> Result<String, ApiError> {
|
||||
let output = tera.render("hello_world.html", &Context::new()).unwrap();
|
||||
|
||||
Ok(output)
|
||||
}
|
||||
10
src/server/routes/index.rs
Normal file
10
src/server/routes/index.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use axum::{response::Html, Extension};
|
||||
use tera::{Context, Tera};
|
||||
|
||||
use crate::error::ApiError;
|
||||
|
||||
pub async fn index_handler(Extension(tera): Extension<Tera>) -> Result<Html<String>, ApiError> {
|
||||
let output = tera.render("index.html", &Context::new()).unwrap();
|
||||
|
||||
Ok(output.into())
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
pub mod file;
|
||||
pub mod hello_world;
|
||||
pub mod index;
|
||||
pub mod ingress;
|
||||
pub mod query;
|
||||
pub mod queue_length;
|
||||
|
||||
Reference in New Issue
Block a user