mirror of
https://github.com/actix/examples
synced 2025-06-26 09:17:41 +02:00
upgrade actix-web to 0.6
This commit is contained in:
@ -16,4 +16,4 @@ path = "src/server.rs"
|
||||
env_logger = "0.5"
|
||||
futures = "0.1"
|
||||
actix = "0.5"
|
||||
actix-web = { version = "^0.5", features=["alpn"] }
|
||||
actix-web = { version = "^0.6", features=["alpn"] }
|
||||
|
@ -3,8 +3,8 @@ extern crate actix_web;
|
||||
extern crate env_logger;
|
||||
extern crate futures;
|
||||
|
||||
use actix_web::{client, middleware, server, App, AsyncResponder, Body, Error, HttpMessage,
|
||||
HttpRequest, HttpResponse};
|
||||
use actix_web::{client, middleware, server, App, AsyncResponder, Body, Error,
|
||||
HttpMessage, HttpRequest, HttpResponse};
|
||||
use futures::{Future, Stream};
|
||||
|
||||
/// Stream client request response and then send body to a server response
|
||||
@ -48,7 +48,7 @@ fn main() {
|
||||
.middleware(middleware::Logger::default())
|
||||
.resource("/streaming", |r| r.f(streaming))
|
||||
.resource("/", |r| r.f(index))
|
||||
}).threads(1)
|
||||
}).workers(1)
|
||||
.bind("127.0.0.1:8080")
|
||||
.unwrap()
|
||||
.start();
|
||||
|
@ -24,7 +24,7 @@ fn main() {
|
||||
.middleware(middleware::Logger::default())
|
||||
.resource("/index.html", |r| r.f(|_| "Hello world!"))
|
||||
.resource("/", |r| r.f(index))
|
||||
}).threads(1)
|
||||
}).workers(1)
|
||||
.bind("127.0.0.1:8081")
|
||||
.unwrap()
|
||||
.start();
|
||||
|
Reference in New Issue
Block a user