Update to latest actix-web.

This commit is contained in:
LukeMathWalker 2021-05-01 16:11:16 +01:00
parent 1caa47a383
commit 7bdc51cae9
3 changed files with 363 additions and 337 deletions

691
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -13,7 +13,10 @@ path = "src/main.rs"
name = "zero2prod" name = "zero2prod"
[dependencies] [dependencies]
actix-web = "4.0.0-beta.3" actix-http = "=3.0.0-beta.5"
actix-service = "=2.0.0-beta.5"
actix-web = "=4.0.0-beta.5"
serde = "1.0.115" serde = "1.0.115"
config = { version = "0.10.1", default-features = false, features = ["yaml"] } config = { version = "0.10.1", default-features = false, features = ["yaml"] }
sqlx = { version = "0.5.1", default-features = false, features = [ "runtime-actix-rustls", "macros", "postgres", "uuid", "chrono", "migrate", "offline"] } sqlx = { version = "0.5.1", default-features = false, features = [ "runtime-actix-rustls", "macros", "postgres", "uuid", "chrono", "migrate", "offline"] }
@ -25,10 +28,10 @@ tracing-futures = "0.2.4"
tracing-subscriber = { version = "0.2.12", features = ["registry", "env-filter"] } tracing-subscriber = { version = "0.2.12", features = ["registry", "env-filter"] }
tracing-bunyan-formatter = "0.1.6" tracing-bunyan-formatter = "0.1.6"
tracing-log = "0.1.1" tracing-log = "0.1.1"
tracing-actix-web = "0.3.0-beta.2"
serde-aux = "1.0.1" serde-aux = "1.0.1"
unicode-segmentation = "1.7.1" unicode-segmentation = "1.7.1"
validator = "0.12.0" validator = "0.12.0"
tracing-actix-web = "0.4.0-beta.4"
[dev-dependencies] [dev-dependencies]
once_cell = "1.7.2" once_cell = "1.7.2"

View file

@ -66,7 +66,7 @@ fn run(
let email_client = Data::new(email_client); let email_client = Data::new(email_client);
let server = HttpServer::new(move || { let server = HttpServer::new(move || {
App::new() App::new()
.wrap(TracingLogger) .wrap(TracingLogger::default())
.route("/health_check", web::get().to(health_check)) .route("/health_check", web::get().to(health_check))
.route("/subscriptions", web::post().to(subscribe)) .route("/subscriptions", web::post().to(subscribe))
.app_data(db_pool.clone()) .app_data(db_pool.clone())