1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00

update actix-web to 1.0.0

This commit is contained in:
Nikolay Kim 2019-06-06 16:47:40 +06:00
parent db86fdc3db
commit aa5750cafc
35 changed files with 69 additions and 69 deletions

View File

@ -6,8 +6,8 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix = "0.8.1" actix = "0.8.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-redis = { git="https://github.com/actix/actix-redis.git" } actix-redis = { git="https://github.com/actix/actix-redis.git" }
futures = "0.1.23" futures = "0.1.23"
redis-async = "0.4.0" redis-async = "0.4.0"

View File

@ -6,9 +6,9 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.5" actix-web = "1.0.0"
actix-files = "0.1.0-beta.4" actix-files = "0.1.1"
actix-session = "0.1.0-beta.4" actix-session = "0.1.0"
dotenv = "0.13.0" dotenv = "0.13.0"
env_logger = "0.5.10" env_logger = "0.5.10"
futures = "0.1.22" futures = "0.1.22"

View File

@ -6,8 +6,8 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix-rt = "0.2" actix-rt = "0.2.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
dotenv = "0.10" dotenv = "0.10"
env_logger = "0.5" env_logger = "0.5"

View File

@ -6,8 +6,8 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix-rt = "0.2" actix-rt = "0.2.2"
actix-web = { version="1.0.0-alpha.4", features=["ssl"] } actix-web = { version="1.0.0", features=["ssl"] }
futures = "0.1" futures = "0.1"
serde = "1.0.43" serde = "1.0.43"

View File

@ -7,9 +7,9 @@ workspace = ".."
[dependencies] [dependencies]
actix-rt = "0.2.2" actix-rt = "0.2.2"
actix-web = { version="1.0.0-beta.4", features=["ssl"] } actix-web = { version="1.0.0", features=["ssl"] }
actix-multipart = "0.1.0-beta.1" actix-multipart = "0.1.1"
actix-service = "0.4.0" actix-service = "0.4.1"
bytes = "0.4.12" bytes = "0.4.12"
env_logger = "0.6.1" env_logger = "0.6.1"
futures = "0.1" futures = "0.1"

View File

@ -6,10 +6,10 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-rt = "0.2" actix-rt = "0.2.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-files = "0.1.0-beta.4" actix-files = "0.1.1"
actix-session = "0.1.0-beta.4" actix-session = "0.1.0"
futures = "0.1.25" futures = "0.1.25"
env_logger = "0.5" env_logger = "0.5"

View File

@ -6,5 +6,5 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
env_logger = "0.6" env_logger = "0.6"

View File

@ -6,8 +6,8 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-session = "0.1.0-beta.4" actix-session = "0.1.0"
futures = "0.1" futures = "0.1"
time = "0.1" time = "0.1"

View File

@ -6,7 +6,7 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
bytes = "0.4" bytes = "0.4"
env_logger = "0.6" env_logger = "0.6"

View File

@ -6,7 +6,7 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
derive_more = "0.14.0" derive_more = "0.14.0"
futures = "0.1.23" futures = "0.1.23"

View File

@ -6,7 +6,7 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"

View File

@ -6,5 +6,5 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
env_logger = "0.6" env_logger = "0.6"

View File

@ -7,7 +7,7 @@ edition = "2018"
[dependencies] [dependencies]
actix-rt = "0.2" actix-rt = "0.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
clap = "2.32.0" clap = "2.32.0"
futures = "0.1.25" futures = "0.1.25"

View File

@ -15,7 +15,7 @@ path = "src/server.rs"
[dependencies] [dependencies]
actix-rt = "0.2" actix-rt = "0.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
env_logger = "0.5" env_logger = "0.5"
futures = "0.1" futures = "0.1"

View File

@ -6,7 +6,7 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
bytes = "0.4" bytes = "0.4"
futures = "0.1" futures = "0.1"

View File

@ -6,8 +6,8 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix = "0.8.1" actix = "0.8.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
env_logger = "0.6" env_logger = "0.6"
futures = "0.1.23" futures = "0.1.23"
futures-timer = "0.1" futures-timer = "0.1"

View File

@ -6,7 +6,7 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
env_logger = "0.6" env_logger = "0.6"
futures = "0.1" futures = "0.1"
serde = "1.0" serde = "1.0"

View File

@ -6,7 +6,7 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix-service = "0.4.0" actix-service = "0.4.1"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
futures = "0.1.25" futures = "0.1.25"
env_logger = "0.6" env_logger = "0.6"

View File

@ -10,8 +10,8 @@ name = "multipart"
path = "src/main.rs" path = "src/main.rs"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-multipart = "0.1.0-beta.4" actix-multipart = "0.1.1"
env_logger = "0.6" env_logger = "0.6"
futures = "0.1.25" futures = "0.1.25"

View File

@ -13,6 +13,6 @@ derive_more = "0.14"
prost = "0.4.0" prost = "0.4.0"
prost-derive = "0.4.0" prost-derive = "0.4.0"
actix = "0.8.1" actix = "0.8.2"
actix-web = "1.0.0-rc" actix-web = "1.0.0"
actix-protobuf = "0.4.0" actix-protobuf = "0.4.0"

View File

@ -7,7 +7,7 @@ workspace = ".."
[dependencies] [dependencies]
actix-rt = "0.2" actix-rt = "0.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
futures = "0.1" futures = "0.1"
env_logger = "0.6" env_logger = "0.6"

View File

@ -6,8 +6,8 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix = "0.8.1" actix = "0.8.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-session = "0.1.0-beta.4" actix-session = "0.1.0"
actix-redis = { git = "https://github.com/actix/actix-redis.git", features = ["web"] } actix-redis = { git = "https://github.com/actix/actix-redis.git", features = ["web"] }
env_logger = "0.6" env_logger = "0.6"

View File

@ -12,5 +12,5 @@ path = "src/main.rs"
[dependencies] [dependencies]
env_logger = "0.5" env_logger = "0.5"
rustls = "0.15" rustls = "0.15"
actix-web = { version = "1.0.0-beta.4", features=["rust-tls"] } actix-web = { version = "1.0.0", features=["rust-tls"] }
actix-files = "0.1.0-beta.4" actix-files = "0.1.0"

View File

@ -6,10 +6,10 @@ edition = "2018"
workspace = ".." workspace = ".."
[dependencies] [dependencies]
actix = { version = "0.8.1", features = ["http"] } actix = "0.8.2"
actix-rt = "0.2.2" actix-rt = "0.2.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-files = "0.1.0-beta.4" actix-files = "0.1.1"
bcrypt = "0.2.1" bcrypt = "0.2.1"
chrono = { version = "0.4.6", features = ["serde"] } chrono = { version = "0.4.6", features = ["serde"] }

View File

@ -6,6 +6,6 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
futures = "0.1.25" futures = "0.1.25"
env_logger = "0.6" env_logger = "0.6"

View File

@ -12,12 +12,12 @@
//! Check [user guide](https://actix.rs/book/actix-web/sec-2-application.html) for more info. //! Check [user guide](https://actix.rs/book/actix-web/sec-2-application.html) for more info.
use std::io; use std::io;
use std::sync::{Arc, Mutex}; use std::sync::Mutex;
use actix_web::{middleware, web, App, HttpRequest, HttpResponse, HttpServer}; use actix_web::{middleware, web, App, HttpRequest, HttpResponse, HttpServer};
/// simple handle /// simple handle
fn index(state: web::Data<Arc<Mutex<usize>>>, req: HttpRequest) -> HttpResponse { fn index(state: web::Data<Mutex<usize>>, req: HttpRequest) -> HttpResponse {
println!("{:?}", req); println!("{:?}", req);
*(state.lock().unwrap()) += 1; *(state.lock().unwrap()) += 1;
@ -28,12 +28,12 @@ fn main() -> io::Result<()> {
std::env::set_var("RUST_LOG", "actix_web=info"); std::env::set_var("RUST_LOG", "actix_web=info");
env_logger::init(); env_logger::init();
let counter = Arc::new(Mutex::new(0usize)); let counter = web::Data::new(Mutex::new(0usize));
//move is necessary to give closure below ownership of counter //move is necessary to give closure below ownership of counter
HttpServer::new(move || { HttpServer::new(move || {
App::new() App::new()
.data(counter.clone()) // <- create app with shared state .register_data(counter.clone()) // <- create app with shared state
// enable logger // enable logger
.wrap(middleware::Logger::default()) .wrap(middleware::Logger::default())
// register simple handler, handle all methods // register simple handler, handle all methods

View File

@ -9,5 +9,5 @@ edition = "2018"
futures = "0.1" futures = "0.1"
env_logger = "0.5" env_logger = "0.5"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-files = "0.1.0-beta.4" actix-files = "0.1.1"

View File

@ -6,7 +6,7 @@ workspace = ".."
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
env_logger = "0.6" env_logger = "0.6"
askama = "0.8" askama = "0.8"

View File

@ -8,4 +8,4 @@ edition = "2018"
[dependencies] [dependencies]
env_logger = "0.6" env_logger = "0.6"
tera = "0.11" tera = "0.11"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"

View File

@ -12,7 +12,7 @@ env_logger = "0.6"
yarte = { version = "0.2", features=["with-actix-web"] } yarte = { version = "0.2", features=["with-actix-web"] }
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
[build-dependencies] [build-dependencies]
yarte = { version = "0.2", features=["with-actix-web"] } yarte = { version = "0.2", features=["with-actix-web"] }
@ -20,4 +20,4 @@ yarte = { version = "0.2", features=["with-actix-web"] }
[dev-dependencies] [dev-dependencies]
bytes = "0.4" bytes = "0.4"
actix-http-test = "0.2.0" actix-http-test = "0.2.0"
actix-http = "0.2.0" actix-http = "0.2.3"

View File

@ -11,6 +11,6 @@ path = "src/main.rs"
[dependencies] [dependencies]
actix-rt = "0.2" actix-rt = "0.2"
actix-web = { version="1.0.0-beta.4", features=["ssl"] } actix-web = { version="1.0.0", features=["ssl"] }
env_logger = "0.6" env_logger = "0.6"
openssl = { version="0.10" } openssl = { version="0.10" }

View File

@ -6,7 +6,7 @@ workspace = "../../"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
serde_json = "1.0" serde_json = "1.0"

View File

@ -10,10 +10,10 @@ name = "websocket-chat-server"
path = "src/main.rs" path = "src/main.rs"
[dependencies] [dependencies]
actix = "0.8.1" actix = "0.8.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-web-actors = "1.0.0-beta.4" actix-web-actors = "1.0.0"
actix-files = "0.1.0-beta.4" actix-files = "0.1.1"
rand = "0.6" rand = "0.6"
bytes = "0.4" bytes = "0.4"

View File

@ -14,10 +14,10 @@ name = "websocket-tcp-client"
path = "src/client.rs" path = "src/client.rs"
[dependencies] [dependencies]
actix = "0.8.1" actix = "0.8.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-web-actors = "1.0.0-beta.4" actix-web-actors = "1.0.0"
actix-files = "0.1.0-beta.4" actix-files = "0.1.1"
rand = "0.6" rand = "0.6"
bytes = "0.4" bytes = "0.4"

View File

@ -14,10 +14,10 @@ path = "src/main.rs"
#path = "src/client.rs" #path = "src/client.rs"
[dependencies] [dependencies]
actix = "0.8.1" actix = "0.8.2"
actix-web = "1.0.0-beta.4" actix-web = "1.0.0"
actix-web-actors = "1.0.0-beta.4" actix-web-actors = "1.0.0"
actix-files = "0.1.0-beta.4" actix-files = "0.1.1"
env_logger = "0.6" env_logger = "0.6"
futures = "0.1" futures = "0.1"
bytes = "0.4" bytes = "0.4"