mirror of
https://github.com/actix/examples
synced 2024-11-27 16:02:57 +01:00
upgrade to beta3
This commit is contained in:
parent
d571ee5abb
commit
8de183768c
@ -6,8 +6,8 @@ edition = "2018"
|
||||
workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix = "0.8.0-alpha.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix = "0.8.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-redis = { git="https://github.com/actix/actix-redis.git" }
|
||||
futures = "0.1.23"
|
||||
redis-async = "0.4.0"
|
||||
|
@ -6,9 +6,9 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-files = "0.1.0-alpha.4"
|
||||
actix-session = "0.1.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-files = "0.1.0-beta.1"
|
||||
actix-session = "0.1.0-beta.2"
|
||||
dotenv = "0.13.0"
|
||||
env_logger = "0.5.10"
|
||||
futures = "0.1.22"
|
||||
|
@ -7,7 +7,7 @@ workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "0.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
dotenv = "0.10"
|
||||
env_logger = "0.5"
|
||||
|
@ -7,9 +7,9 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "0.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-files = "0.1.0-alpha.4"
|
||||
actix-session = "0.1.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-files = "0.1.0-beta.1"
|
||||
actix-session = "0.1.0-beta.2"
|
||||
|
||||
futures = "0.1.25"
|
||||
env_logger = "0.5"
|
||||
|
@ -6,5 +6,5 @@ edition = "2018"
|
||||
workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
env_logger = "0.6"
|
||||
|
@ -6,8 +6,8 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-session = "0.1.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-session = "0.1.0-beta.2"
|
||||
|
||||
futures = "0.1"
|
||||
time = "0.1"
|
||||
|
@ -6,7 +6,7 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
bytes = "0.4"
|
||||
env_logger = "0.6"
|
||||
|
@ -137,22 +137,20 @@ fn main() -> std::io::Result<()> {
|
||||
// Use of the extractors makes some post conditions simpler such
|
||||
// as size limit protections and built in json validation.
|
||||
.service(
|
||||
web::resource("/add2").route(
|
||||
web::post()
|
||||
.data(
|
||||
web::JsonConfig::default()
|
||||
.limit(4096) // <- limit size of the payload
|
||||
.error_handler(|err, _| {
|
||||
// <- create custom error response
|
||||
error::InternalError::from_response(
|
||||
err,
|
||||
HttpResponse::Conflict().finish(),
|
||||
)
|
||||
.into()
|
||||
}),
|
||||
)
|
||||
.to_async(add2),
|
||||
),
|
||||
web::resource("/add2")
|
||||
.data(
|
||||
web::JsonConfig::default()
|
||||
.limit(4096) // <- limit size of the payload
|
||||
.error_handler(|err, _| {
|
||||
// <- create custom error response
|
||||
error::InternalError::from_response(
|
||||
err,
|
||||
HttpResponse::Conflict().finish(),
|
||||
)
|
||||
.into()
|
||||
}),
|
||||
)
|
||||
.route(web::post().to_async(add2)),
|
||||
)
|
||||
// Manual parsing would allow custom error construction, use of
|
||||
// other parsers *beside* json (for example CBOR, protobuf, xml), and allows
|
||||
|
@ -6,7 +6,7 @@ edition = "2018"
|
||||
workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
derive_more = "0.14.0"
|
||||
futures = "0.1.23"
|
||||
|
@ -6,7 +6,7 @@ edition = "2018"
|
||||
workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
|
@ -6,5 +6,5 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
env_logger = "0.6"
|
||||
|
@ -7,7 +7,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "0.2"
|
||||
actix-web = "1.0.0-alpha.5"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
clap = "2.32.0"
|
||||
futures = "0.1.25"
|
||||
|
@ -15,7 +15,7 @@ path = "src/server.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "0.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
env_logger = "0.5"
|
||||
futures = "0.1"
|
||||
|
@ -6,7 +6,7 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
bytes = "0.4"
|
||||
futures = "0.1"
|
||||
|
@ -83,19 +83,12 @@ fn main() -> std::io::Result<()> {
|
||||
App::new()
|
||||
// enable logger
|
||||
.wrap(middleware::Logger::default())
|
||||
.data(web::JsonConfig::default().limit(4096)) // <- limit size of the payload (global configuration)
|
||||
.service(web::resource("/extractor").route(web::post().to(index)))
|
||||
.service(
|
||||
web::resource("/extractor").route(
|
||||
web::post()
|
||||
.data(web::JsonConfig::default().limit(4096)) // <- limit size of the payload
|
||||
.to(index),
|
||||
),
|
||||
)
|
||||
.service(
|
||||
web::resource("/extractor2").route(
|
||||
web::post()
|
||||
.data(web::JsonConfig::default().limit(4096)) // <- limit size of the payload
|
||||
.to_async(extract_item),
|
||||
),
|
||||
web::resource("/extractor2")
|
||||
.data(web::JsonConfig::default().limit(1024)) // <- limit size of the payload (resource level)
|
||||
.route(web::post().to_async(extract_item)),
|
||||
)
|
||||
.service(web::resource("/manual").route(web::post().to_async(index_manual)))
|
||||
.service(
|
||||
|
@ -6,8 +6,8 @@ edition = "2018"
|
||||
workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix = "0.8.0-alpha.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix = "0.8.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
env_logger = "0.6"
|
||||
futures = "0.1.23"
|
||||
futures-timer = "0.1"
|
||||
|
@ -6,7 +6,7 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
env_logger = "0.6"
|
||||
futures = "0.1"
|
||||
serde = "1.0"
|
||||
|
@ -7,6 +7,6 @@ workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix-service = "0.3.6"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
futures = "0.1.25"
|
||||
env_logger = "0.6"
|
@ -10,7 +10,7 @@ name = "multipart"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-beta.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-multipart = "0.1.0-beta.1"
|
||||
|
||||
env_logger = "0.6"
|
||||
|
@ -23,11 +23,10 @@ pub fn save_file(field: Field) -> impl Future<Item = i64, Error = Error> {
|
||||
// fs operations are blocking, we have to execute writes
|
||||
// on threadpool
|
||||
web::block(move || {
|
||||
file.write_all(bytes.as_ref())
|
||||
.map_err(|e| {
|
||||
println!("file.write_all failed: {:?}", e);
|
||||
MultipartError::Payload(error::PayloadError::Io(e))
|
||||
})?;
|
||||
file.write_all(bytes.as_ref()).map_err(|e| {
|
||||
println!("file.write_all failed: {:?}", e);
|
||||
MultipartError::Payload(error::PayloadError::Io(e))
|
||||
})?;
|
||||
acc += bytes.len() as i64;
|
||||
Ok((file, acc))
|
||||
})
|
||||
|
@ -13,4 +13,4 @@ derive_more = "0.14"
|
||||
prost = "0.2.0"
|
||||
prost-derive = "0.2.0"
|
||||
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
@ -7,7 +7,7 @@ workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "0.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
futures = "0.1"
|
||||
env_logger = "0.6"
|
||||
|
@ -6,8 +6,8 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix = "0.8.0-alpha.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-session = "0.1.0-alpha.4"
|
||||
actix = "0.8.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-session = "0.1.0-beta.2"
|
||||
actix-redis = { git = "https://github.com/actix/actix-redis.git", features = ["web"] }
|
||||
env_logger = "0.6"
|
||||
|
@ -8,7 +8,7 @@ workspace = ".."
|
||||
[dependencies]
|
||||
actix = { version = "0.8.1", features = ["http"] }
|
||||
actix-rt = "0.2.2"
|
||||
actix-web = "1.0.0-beta.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-files = "0.1.0-beta.1"
|
||||
|
||||
bcrypt = "0.2.1"
|
||||
|
@ -6,6 +6,6 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
futures = "0.1.25"
|
||||
env_logger = "0.6"
|
||||
|
@ -9,5 +9,5 @@ edition = "2018"
|
||||
futures = "0.1"
|
||||
env_logger = "0.5"
|
||||
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-files = "0.1.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-files = "0.1.0-beta.1"
|
||||
|
@ -6,7 +6,7 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
env_logger = "0.6"
|
||||
askama = "0.8"
|
||||
|
||||
|
@ -8,4 +8,4 @@ edition = "2018"
|
||||
[dependencies]
|
||||
env_logger = "0.6"
|
||||
tera = "0.11"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
@ -12,7 +12,7 @@ env_logger = "0.6"
|
||||
|
||||
yarte = { version = "0.2", features=["with-actix-web"] }
|
||||
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
|
||||
[build-dependencies]
|
||||
yarte = { version = "0.2", features=["with-actix-web"] }
|
||||
|
@ -6,7 +6,7 @@ workspace = "../../"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
|
@ -10,10 +10,10 @@ name = "websocket-chat-server"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
actix = "0.8.0-alpha.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix-web-actors = "1.0.0-alpha.2"
|
||||
actix-files = "0.1.0-alpha.4"
|
||||
actix = "0.8.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-web-actors = "1.0.0-alpha.3"
|
||||
actix-files = "0.1.0-beta.1"
|
||||
|
||||
rand = "0.6"
|
||||
bytes = "0.4"
|
||||
|
@ -14,10 +14,10 @@ name = "websocket-tcp-client"
|
||||
path = "src/client.rs"
|
||||
|
||||
[dependencies]
|
||||
actix = "0.8.0-alpha.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix = "0.8.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-web-actors = "1.0.0-alpha.3"
|
||||
actix-files = "0.1.0-alpha.4"
|
||||
actix-files = "0.1.0-beta.1"
|
||||
|
||||
rand = "0.6"
|
||||
bytes = "0.4"
|
||||
|
@ -14,10 +14,10 @@ path = "src/main.rs"
|
||||
#path = "src/client.rs"
|
||||
|
||||
[dependencies]
|
||||
actix = "0.8.0-alpha.2"
|
||||
actix-web = "1.0.0-alpha.4"
|
||||
actix = "0.8.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-web-actors = "1.0.0-alpha.3"
|
||||
actix-files = "0.1.0-alpha.4"
|
||||
actix-files = "0.1.0-beta.1"
|
||||
env_logger = "0.6"
|
||||
futures = "0.1"
|
||||
bytes = "0.4"
|
Loading…
Reference in New Issue
Block a user