浏览代码

fix cli tests

Evan Almloff 1 年之前
父节点
当前提交
9bb464dd7d
共有 4 个文件被更改,包括 9 次插入9 次删除
  1. 1 1
      packages/cli/Cargo.toml
  2. 4 4
      packages/cli/README.md
  3. 2 2
      packages/cli/src/server/web/mod.rs
  4. 2 2
      packages/cli/src/server/web/proxy.rs

+ 1 - 1
packages/cli/Cargo.toml

@@ -37,7 +37,7 @@ hyper-rustls = "0.23.2"
 indicatif = "0.17.5"
 subprocess = "0.2.9"
 
-axum = { version = "0.6.20", features = ["ws", "headers"] }
+axum = { version = "0.5.1", features = ["ws", "headers"] }
 axum-server = { version = "0.5.1", features = ["tls-rustls"] }
 tower-http = { version = "0.2.2", features = ["full"] }
 headers = "0.3.7"

+ 4 - 4
packages/cli/README.md

@@ -10,7 +10,7 @@ It handles building, bundling, development and publishing to simplify developmen
 
 ### Install the stable version (recommended)
 
-```
+```sh
 cargo install dioxus-cli
 ```
 
@@ -20,7 +20,7 @@ To get the latest bug fixes and features, you can install the development versio
 However, this is not fully tested.
 That means you're probably going to have more bugs despite having the latest bug fixes.
 
-```
+```sh
 cargo install --git https://github.com/DioxusLabs/dioxus dioxus-cli
 ```
 
@@ -29,7 +29,7 @@ and install it in Cargo's global binary directory (`~/.cargo/bin/` by default).
 
 ### Install from local folder
 
-```
+```sh
 cargo install --path . --debug
 ```
 
@@ -40,7 +40,7 @@ It will be cloned from the [dioxus-template](https://github.com/DioxusLabs/dioxu
 
 Alternatively, you can specify the template path:
 
-```
+```sh
 dx create hello --template gh:dioxuslabs/dioxus-template
 ```
 

+ 2 - 2
packages/cli/src/server/web/mod.rs

@@ -313,9 +313,9 @@ async fn setup_router(
     router = if let Some(base_path) = config.dioxus_config.web.app.base_path.clone() {
         let base_path = format!("/{}", base_path.trim_matches('/'));
         Router::new()
-            .nest_service(
+            .nest(
                 &base_path,
-                axum::routing::method_routing::any_service(router),
+                axum::routing::any_service(router),
             )
             .fallback(get(move || {
                 let base_path = base_path.clone();

+ 2 - 2
packages/cli/src/server/web/proxy.rs

@@ -1,6 +1,6 @@
-use crate::Result;
+use crate::{Result,};
 use dioxus_cli_config::WebProxyConfig;
-
+   
 use anyhow::Context;
 use axum::{http::StatusCode, routing::any, Router};
 use hyper::{Request, Response, Uri};