This commit is contained in:
Per Stark
2024-12-03 16:09:11 +01:00
parent 1fad4a5b1a
commit 58ddc1f824
6 changed files with 28 additions and 19 deletions

View File

@@ -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)
}

View 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())
}

View File

@@ -1,5 +1,5 @@
pub mod file;
pub mod hello_world;
pub mod index;
pub mod ingress;
pub mod query;
pub mod queue_length;

View File

@@ -1,4 +0,0 @@
<h1>Hello</h1>
<div>Hello</div>
<p>HI</p>
wowoow

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
Hello world!
</body>
</html>