diff options
| -rw-r--r-- | crates/whirl_api/Cargo.toml | 4 | ||||
| -rw-r--r-- | crates/whirl_api/src/lib.rs | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/crates/whirl_api/Cargo.toml b/crates/whirl_api/Cargo.toml index b851053..30a2986 100644 --- a/crates/whirl_api/Cargo.toml +++ b/crates/whirl_api/Cargo.toml @@ -14,9 +14,7 @@ publish = false [dependencies] # Web-server -actix-web = { version = "3.3.2", features = ["rustls"] } -actix-cors = "0.5.4" -axum = "0.1.3" +axum = "0.4.4" hyper = "0.14.13" # Utility diff --git a/crates/whirl_api/src/lib.rs b/crates/whirl_api/src/lib.rs index d3c3a0c..efbec1a 100644 --- a/crates/whirl_api/src/lib.rs +++ b/crates/whirl_api/src/lib.rs @@ -30,7 +30,7 @@ extern crate log; #[macro_use] extern crate serde_derive; -use axum::prelude::*; +use axum::routing::get; mod routes; @@ -47,12 +47,13 @@ impl Api { /// server. pub async fn listen(address: &str) { // TODO: Version handler - let app = route("/", get(|| async { "Whirlsplash" })) + let app = axum::Router::new() + .route("/", get(|| async { "Whirlsplash" })) .route("/api/v1/stats", get(routes::stats::statistics)) .route("/api/v1/worlds/info", get(routes::worlds::info::info)) .route("/api/v1/worlds/vip", get(routes::worlds::vip::vip)); - hyper::Server::bind(&address.parse().unwrap()) + axum::Server::bind(&address.parse().unwrap()) .serve(app.into_make_service()) .await .unwrap(); |