mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2025-01-05 22:58:49 +00:00
Remove actix_rt direct usage.
This commit is contained in:
parent
28d438b478
commit
f80816aad6
4 changed files with 16 additions and 3 deletions
13
Cargo.lock
generated
13
Cargo.lock
generated
|
@ -1415,13 +1415,26 @@ dependencies = [
|
|||
"libc",
|
||||
"memchr",
|
||||
"mio 0.7.13",
|
||||
"num_cpus",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"pin-project-lite",
|
||||
"signal-hook-registry",
|
||||
"tokio-macros",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-macros"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-native-tls"
|
||||
version = "0.3.0"
|
||||
|
|
|
@ -14,7 +14,7 @@ name = "zero2prod"
|
|||
|
||||
[dependencies]
|
||||
actix-web = "=4.0.0-beta.15"
|
||||
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
||||
|
||||
[dev-dependencies]
|
||||
reqwest = "0.11"
|
||||
tokio = "1"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::net::TcpListener;
|
||||
use zero2prod::run;
|
||||
|
||||
#[actix_web::main]
|
||||
#[tokio::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let address = TcpListener::bind("127.0.0.1:8000")?;
|
||||
run(address)?.await
|
||||
|
|
|
@ -11,7 +11,7 @@ fn spawn_app() -> String {
|
|||
format!("http://127.0.0.1:{}", port)
|
||||
}
|
||||
|
||||
#[actix_web::test]
|
||||
#[tokio::test]
|
||||
async fn health_check_works() {
|
||||
// Arrange
|
||||
let address = spawn_app();
|
||||
|
|
Loading…
Reference in a new issue