Skip to content

Commit

Permalink
feat: add html example
Browse files Browse the repository at this point in the history
  • Loading branch information
ikurotime committed Dec 28, 2023
1 parent 9803eba commit 4a394a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/web_routes.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use askama::Template;
use axum::{
http::StatusCode,
response::{Html, IntoResponse},
response::{Html, IntoResponse, Response},
routing::get,
Response, Router,
Router,
};

pub fn get_routes() -> Router {
Expand All @@ -13,6 +13,7 @@ async fn get_index() -> impl IntoResponse {
let template = HelloTemplate {};
HtmlTemplate(template)
}

#[derive(Template)]
#[template(path = "index.html")]
struct HelloTemplate;
Expand Down
1 change: 1 addition & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>hello</h1>

0 comments on commit 4a394a0

Please sign in to comment.