mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-10-22 21:51:19 +00:00
Close #153: Feature gate http API
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
2 files changed
+6
-1
No files matched your search
+2
-1
@@ -7,8 +7,9 @@ license-file = "LICENSE"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[features]
|
||||
default = ["message"]
|
||||
default = ["message", "http-api"]
|
||||
message = []
|
||||
http-api = []
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "1.36.0", features = [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::net::{IpAddr, Ipv6Addr, SocketAddr};
|
||||
|
||||
#[cfg(feature = "http-api")]
|
||||
use api::Http;
|
||||
use bytes::BytesMut;
|
||||
use data::DataPlane;
|
||||
@@ -64,6 +65,7 @@ pub struct Stack {
|
||||
_pm: peer_manager::PeerManager,
|
||||
#[cfg(feature = "message")]
|
||||
_ms: message::MessageStack,
|
||||
#[cfg(feature = "http-api")]
|
||||
_api: api::Http,
|
||||
}
|
||||
|
||||
@@ -170,6 +172,7 @@ impl Stack {
|
||||
#[cfg(feature = "message")]
|
||||
let ms = MessageStack::new(_data_plane, msg_receiver);
|
||||
|
||||
#[cfg(feature = "http-api")]
|
||||
let api = Http::spawn(
|
||||
router.clone(),
|
||||
pm.clone(),
|
||||
@@ -183,6 +186,7 @@ impl Stack {
|
||||
_pm: pm,
|
||||
#[cfg(feature = "message")]
|
||||
_ms: ms,
|
||||
#[cfg(feature = "http-api")]
|
||||
_api: api,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user