diff options
| author | Fuwn <[email protected]> | 2022-01-14 17:05:07 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-01-14 17:05:07 +0000 |
| commit | 3527fca579c73760001ff0890fdb93ee83c506e5 (patch) | |
| tree | 0e848d91e216972ae44f9733a7ccd1bb6405aa76 /crates/whirl_api/src/lib.rs | |
| parent | feat(server): indicate which server type accepted client (diff) | |
| download | whirl-3527fca579c73760001ff0890fdb93ee83c506e5.tar.xz whirl-3527fca579c73760001ff0890fdb93ee83c506e5.zip | |
chore(whirl_api): update axum finally
Diffstat (limited to 'crates/whirl_api/src/lib.rs')
| -rw-r--r-- | crates/whirl_api/src/lib.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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(); |