Compare commits

...

2 Commits

Author SHA1 Message Date
Franz Dietrich 8121dbcb7c add favicon 2023-06-15 10:48:42 +02:00
Franz Dietrich ba15f8ed0c no need for bulma.js 2023-06-15 10:24:05 +02:00
3 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,7 @@ use axum::{
routing::{get, post},
Form, Json, Router,
};
use hyper::{header, HeaderMap};
use serde::Deserialize;
use sqlx::{query, SqlitePool};
use std::{env, net::SocketAddr};
@ -35,6 +36,7 @@ async fn main() {
.nest_service("/static", ServeDir::new(static_path))
.route("/", get(register_form))
.route("/register/", post(register))
.route("/favicon.ico", get(favicon))
.with_state(db_pool);
// run it
@ -131,3 +133,11 @@ where
{
(StatusCode::INTERNAL_SERVER_ERROR, err.to_string())
}
async fn favicon() -> impl IntoResponse {
let mut headers = HeaderMap::new();
headers.insert(header::CONTENT_TYPE, "image/x-icon".parse().unwrap());
let bytes = include_bytes!("../static/favicon.ico");
(headers, bytes)
}

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -52,7 +52,6 @@
</div>
</div>
</section>
<script async type="text/javascript" src="../js/bulma.js"></script>
</body>
</html>