better unauthorized ip, and adding responder
This commit is contained in:
+2
-5
@@ -3,7 +3,7 @@ use hyper::{
|
||||
body::{Bytes, Incoming},
|
||||
Request, Response,
|
||||
};
|
||||
use servme::Server;
|
||||
use servme::{Responder, Server};
|
||||
use std::convert::Infallible;
|
||||
|
||||
#[tokio::main]
|
||||
@@ -16,8 +16,5 @@ async fn main() {
|
||||
}
|
||||
|
||||
async fn handler(req: Request<Incoming>) -> Result<Response<Full<Bytes>>, Infallible> {
|
||||
Ok(Response::new(Full::new(Bytes::from(format!(
|
||||
"Hello World! {}",
|
||||
req.uri()
|
||||
)))))
|
||||
Responder::text(format!("Hello World! {}", req.uri()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user