From 012771f2fbb026dffac8b60a54d28a68ea82b83a Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Wed, 25 Oct 2023 21:20:47 +0100 Subject: [PATCH] Properly wrap HTML for axum root handler --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 88301c7..fcee6f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use axum::extract::State; +use axum::response::Html; use axum::{ body::Full, http::{Response, StatusCode}, @@ -191,8 +192,8 @@ async fn metrics_handler(State(config): State) -> Result &'static str { - r#"/metrics"# +async fn homepage() -> Html<&'static str> { + Html(r#"/metrics"#) } async fn metrics(config: Config) -> Result, WsError> {