Compare commits
2 Commits
f631097bed
...
8121dbcb7c
Author | SHA1 | Date |
---|---|---|
Franz Dietrich | 8121dbcb7c | |
Franz Dietrich | ba15f8ed0c |
10
src/main.rs
10
src/main.rs
|
@ -7,6 +7,7 @@ use axum::{
|
||||||
routing::{get, post},
|
routing::{get, post},
|
||||||
Form, Json, Router,
|
Form, Json, Router,
|
||||||
};
|
};
|
||||||
|
use hyper::{header, HeaderMap};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use sqlx::{query, SqlitePool};
|
use sqlx::{query, SqlitePool};
|
||||||
use std::{env, net::SocketAddr};
|
use std::{env, net::SocketAddr};
|
||||||
|
@ -35,6 +36,7 @@ async fn main() {
|
||||||
.nest_service("/static", ServeDir::new(static_path))
|
.nest_service("/static", ServeDir::new(static_path))
|
||||||
.route("/", get(register_form))
|
.route("/", get(register_form))
|
||||||
.route("/register/", post(register))
|
.route("/register/", post(register))
|
||||||
|
.route("/favicon.ico", get(favicon))
|
||||||
.with_state(db_pool);
|
.with_state(db_pool);
|
||||||
|
|
||||||
// run it
|
// run it
|
||||||
|
@ -131,3 +133,11 @@ where
|
||||||
{
|
{
|
||||||
(StatusCode::INTERNAL_SERVER_ERROR, err.to_string())
|
(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)
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -52,7 +52,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<script async type="text/javascript" src="../js/bulma.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue