1
0
mirror of https://github.com/actix/actix-website synced 2025-02-13 08:32:20 +01:00
Yuki Okushi e9b3985bcf
Suppress some warnings on CI (#143)
* Suppress some warnings on CI

* Remove unused imports
2020-01-23 10:17:13 +09:00

21 lines
492 B
Rust

// <chunked>
use actix_web::{HttpRequest, HttpResponse, Error};
use bytes::Bytes;
use futures::future::ok;
use futures::stream::once;
async fn index(req: HttpRequest) -> HttpResponse {
HttpResponse::Ok()
.streaming(once(ok::<_, Error>(Bytes::from_static(b"data"))))
}
// </chunked>
pub fn main() {
use actix_web::{web, App, HttpServer};
HttpServer::new(|| App::new().route("/", web::get().to(index)))
.bind("127.0.0.1:8088")
.unwrap()
.run();
}