aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/whirl/Cargo.toml3
-rw-r--r--crates/whirl_api/Cargo.toml5
-rw-r--r--crates/whirl_api/src/lib.rs7
3 files changed, 5 insertions, 10 deletions
diff --git a/crates/whirl/Cargo.toml b/crates/whirl/Cargo.toml
index c95c1bc..347d6ba 100644
--- a/crates/whirl/Cargo.toml
+++ b/crates/whirl/Cargo.toml
@@ -23,7 +23,6 @@ human-panic = "1.0.3"
# simple-error = "0.2.3"
# Utility
-rand = "0.8.4"
async-trait = "0.1.52"
whirl_common = { path = "../whirl_common" }
@@ -47,8 +46,6 @@ tokio-util = { version = "0.6.9", features = ["codec"] }
tokio-stream = "0.1.8"
# Web-server
-actix-web = { version = "3.3.3", features = ["rustls"] }
-actix-cors = "0.5.4"
whirl_api = { path = "../whirl_api" }
# Prompt
diff --git a/crates/whirl_api/Cargo.toml b/crates/whirl_api/Cargo.toml
index aa97a82..0f955d0 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.3", features = ["rustls"] }
-actix-cors = "0.5.4"
-axum = "0.1.3"
+axum = "0.4.4"
hyper = "0.14.13"
# Utility
@@ -24,7 +22,6 @@ sysinfo = "0.20.5"
whirl_common = { path = "../whirl_common" }
tokio = { version = "1.13.0", features = ["full"] }
num-traits = "0.2.14"
-qstring = "0.7.2"
# Serialization
serde = "1.0.133"
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();