Compare commits
	
		
			No commits in common. "8121dbcb7c5ea1bf492d36cba428833af2268d09" and "f631097bed3d97cefdff52076494ca1c28c610fb" have entirely different histories.
		
	
	
		
			8121dbcb7c
			...
			f631097bed
		
	
		
							
								
								
									
										10
									
								
								src/main.rs
								
								
								
								
							
							
						
						
									
										10
									
								
								src/main.rs
								
								
								
								
							|  | @ -7,7 +7,6 @@ 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}; | ||||||
|  | @ -36,7 +35,6 @@ 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
 | ||||||
|  | @ -133,11 +131,3 @@ 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.
										
									
								
							| Before Width: | Height: | Size: 17 KiB | 
|  | @ -52,6 +52,7 @@ | ||||||
|       </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