mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2025-01-23 07:18:06 +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",
|
"libc",
|
||||||
"memchr",
|
"memchr",
|
||||||
"mio 0.7.13",
|
"mio 0.7.13",
|
||||||
|
"num_cpus",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
|
"tokio-macros",
|
||||||
"winapi",
|
"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]]
|
[[package]]
|
||||||
name = "tokio-native-tls"
|
name = "tokio-native-tls"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
|
|
@ -14,7 +14,7 @@ name = "zero2prod"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "=4.0.0-beta.15"
|
actix-web = "=4.0.0-beta.15"
|
||||||
|
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
reqwest = "0.11"
|
reqwest = "0.11"
|
||||||
tokio = "1"
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::net::TcpListener;
|
use std::net::TcpListener;
|
||||||
use zero2prod::run;
|
use zero2prod::run;
|
||||||
|
|
||||||
#[actix_web::main]
|
#[tokio::main]
|
||||||
async fn main() -> std::io::Result<()> {
|
async fn main() -> std::io::Result<()> {
|
||||||
let address = TcpListener::bind("127.0.0.1:8000")?;
|
let address = TcpListener::bind("127.0.0.1:8000")?;
|
||||||
run(address)?.await
|
run(address)?.await
|
||||||
|
|
|
@ -11,7 +11,7 @@ fn spawn_app() -> String {
|
||||||
format!("http://127.0.0.1:{}", port)
|
format!("http://127.0.0.1:{}", port)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_web::test]
|
#[tokio::test]
|
||||||
async fn health_check_works() {
|
async fn health_check_works() {
|
||||||
// Arrange
|
// Arrange
|
||||||
let address = spawn_app();
|
let address = spawn_app();
|
||||||
|
|
Loading…
Reference in a new issue