body update and refactor
This commit is contained in:
parent
bbfef6daef
commit
f352c98e93
3 changed files with 6 additions and 6 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 == "/" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue