Make JSON and HTTP1 support optional (#286)

* Make json support an optional feature

* Fix Json type documentation

* Make hyper's http1 feature optional
This commit is contained in:
Jonas Platte
2021-10-02 15:46:33 +02:00
committed by GitHub
parent cc4ae6b297
commit 250ea0cfef
7 changed files with 28 additions and 8 deletions
+6 -3
View File
@@ -15,8 +15,10 @@ repository = "https://github.com/tokio-rs/axum"
members = ["examples/*"]
[features]
default = ["tower-log"]
default = ["http1", "json", "tower-log"]
http1 = ["hyper/http1"]
http2 = ["hyper/http2"]
json = ["serde_json"]
multipart = ["multer", "mime"]
tower-log = ["tower/log"]
ws = ["tokio-tungstenite", "sha-1", "base64"]
@@ -28,11 +30,11 @@ bytes = "1.0"
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
http = "0.2"
http-body = "0.4.3"
hyper = { version = "0.14", features = ["server", "tcp", "http1", "stream"] }
hyper = { version = "0.14", features = ["server", "tcp", "stream"] }
pin-project-lite = "0.2.7"
regex = "1.5"
serde = "1.0"
serde_json = "1.0"
serde_json = { version = "1.0", optional = true }
serde_urlencoded = "0.7"
tokio = { version = "1", features = ["time"] }
tokio-util = "0.6"
@@ -54,6 +56,7 @@ mime = { optional = true, version = "0.3" }
futures = "0.3"
reqwest = { version = "0.11", features = ["json", "stream"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.6.1", features = ["macros", "rt", "rt-multi-thread", "net"] }
uuid = { version = "0.8", features = ["serde", "v4"] }
tokio-stream = "0.1"