Skip to content

Commit 8109b51

Browse files
committed
feat: started to work on swtiching from http crate to hyper
1 parent ea7a415 commit 8109b51

4 files changed

Lines changed: 307 additions & 133 deletions

File tree

adapter/rest/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.1.0"
44
edition.workspace = true
55

66
[dependencies]
7-
http = { workspace = true }
87
code0-flow = { workspace = true }
98
tokio = { workspace = true }
109
tucana = { workspace = true }
@@ -14,3 +13,7 @@ regex = { workspace = true }
1413
tonic = { workspace = true }
1514
base = { workspace = true }
1615
anyhow = { workspace = true }
16+
hyper-util = "0.1.19"
17+
hyper = "1.8.1"
18+
http-body-util = "0.1.3"
19+
prost = { workspace = true }

adapter/rest/src/config.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use base::traits::LoadConfig;
2+
use code0_flow::flow_config::env_with_default;
3+
4+
5+
#[derive(Clone)]
6+
pub struct HttpServerConfig {
7+
pub port: u16,
8+
pub host: String,
9+
}
10+
11+
impl LoadConfig for HttpServerConfig {
12+
fn load() -> Self {
13+
Self {
14+
port: env_with_default("HTTP_SERVER_PORT", 8080),
15+
host: env_with_default("HTTP_SERVER_HOST", String::from("127.0.0.1")),
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)