adding html to responder, and improving responder, adding data to server

This commit is contained in:
2026-03-11 21:34:57 +01:00
parent 2093456d91
commit 04dff9dbe2
8 changed files with 96 additions and 64 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
use http_body_util::Full;
use hyper::{
body::{Bytes, Incoming},
Request, Response,
body::{Bytes, Incoming},
};
use servme::{Responder, Server};
use std::convert::Infallible;
@@ -16,5 +16,5 @@ async fn main() {
}
async fn handler(req: Request<Incoming>) -> Result<Response<Full<Bytes>>, Infallible> {
Responder::text(&format!("Hello World! {}", req.uri()))
Responder::ok(format!("Hello World! {}", req.uri()))
}