body update and refactor

This commit is contained in:
MeexReay 2024-12-01 02:22:32 +03:00
parent bbfef6daef
commit f352c98e93
3 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@ use ezhttp::{
server::{
starter::HttpServerStarter,
HttpServer
}
}, Sendable
};
struct EzSite {
@ -63,7 +63,7 @@ impl EzSite {
}
impl HttpServer for EzSite {
async fn on_request(&self, req: &HttpRequest) -> Option<HttpResponse> {
async fn on_request(&self, req: &HttpRequest) -> Option<impl Sendable> {
println!("{} > {} {}", req.addr, req.method, req.url.to_path_string());
if let Some(resp) = self.get_main_page(req).await {

View file

@ -1,9 +1,9 @@
use ezhttp::prelude::*;
use ezhttp::{prelude::*, Sendable};
struct EzSite(String);
impl HttpServer for EzSite {
async fn on_request(&self, req: &HttpRequest) -> Option<HttpResponse> {
async fn on_request(&self, req: &HttpRequest) -> Option<impl Sendable> {
println!("{} > {} {}", req.addr, req.method, req.url.to_path_string());
if req.url.path == "/" {