mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-28 01:52:57 +01:00
comments aligned.
This commit is contained in:
parent
7a97de3a1e
commit
ca1b460924
@ -21,8 +21,8 @@ use actix_http::{h1, Response, ServiceConfig};
|
|||||||
fn main() {
|
fn main() {
|
||||||
Server::new().bind("framed_hello", "127.0.0.1:8080", || {
|
Server::new().bind("framed_hello", "127.0.0.1:8080", || {
|
||||||
IntoFramed::new(|| h1::Codec::new(ServiceConfig::default())) // <- create h1 codec
|
IntoFramed::new(|| h1::Codec::new(ServiceConfig::default())) // <- create h1 codec
|
||||||
.and_then(TakeItem::new().map_err(|_| ())) // <- read one request
|
.and_then(TakeItem::new().map_err(|_| ())) // <- read one request
|
||||||
.and_then(|(_req, _framed): (_, Framed<_, _>)| { // <- send response and close conn
|
.and_then(|(_req, _framed): (_, Framed<_, _>)| { // <- send response and close conn
|
||||||
SendResponse::send(_framed, Response::Ok().body("Hello world!"))
|
SendResponse::send(_framed, Response::Ok().body("Hello world!"))
|
||||||
.map_err(|_| ())
|
.map_err(|_| ())
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
|
Loading…
Reference in New Issue
Block a user