diff --git a/Cargo.lock b/Cargo.lock index 7923b8b..83d3435 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -754,7 +754,7 @@ dependencies = [ "cawr-cli", "cawr-db", "cawr-desktop", - "cawr-web-server", + "cawr-web-server-warp", "clap", "directories", "log", @@ -780,7 +780,7 @@ dependencies = [ ] [[package]] -name = "cawr-web-server" +name = "cawr-web-server-warp" version = "0.0.0" dependencies = [ "anyhow", diff --git a/Cargo.toml b/Cargo.toml index c1e5c38..3b107e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ members = [ "crates/infrastructure", "crates/json-boundary", "crates/web-app-api", - "crates/web-server" + "crates/web-server-warp" ] exclude = [ "crates/web-app-seed" ] @@ -43,16 +43,16 @@ rust-version = "1.79" cawr-infrastructure = "0.0.0" [patch.crates-io] -cawr-adapter = { path = "crates/adapter" } -cawr-application = { path = "crates/application" } -cawr-cli = { path = "crates/cli" } -cawr-db = { path = "crates/db" } -cawr-desktop = { path = "crates/desktop" } -cawr-domain = { path = "crates/domain" } -cawr-infrastructure = { path = "crates/infrastructure" } -cawr-json-boundary = { path = "crates/json-boundary" } -cawr-web-app-api = { path = "crates/web-app-api" } -cawr-web-server = { path = "crates/web-server" } +cawr-adapter = { path = "crates/adapter" } +cawr-application = { path = "crates/application" } +cawr-cli = { path = "crates/cli" } +cawr-db = { path = "crates/db" } +cawr-desktop = { path = "crates/desktop" } +cawr-domain = { path = "crates/domain" } +cawr-infrastructure = { path = "crates/infrastructure" } +cawr-json-boundary = { path = "crates/json-boundary" } +cawr-web-app-api = { path = "crates/web-app-api" } +cawr-web-server-warp = { path = "crates/web-server-warp" } [profile.release] lto = true diff --git a/crates/infrastructure/Cargo.toml b/crates/infrastructure/Cargo.toml index 82e1cd1..d3c264e 100644 --- a/crates/infrastructure/Cargo.toml +++ b/crates/infrastructure/Cargo.toml @@ -12,7 +12,7 @@ cawr-adapter = "=0.0.0" cawr-cli = "=0.0.0" cawr-db = "=0.0.0" cawr-desktop = "=0.0.0" -cawr-web-server = "=0.0.0" +cawr-web-server-warp = "=0.0.0" # External dependencies anyhow = "1.0" diff --git a/crates/infrastructure/src/web.rs b/crates/infrastructure/src/web.rs index 20a8020..5507125 100644 --- a/crates/infrastructure/src/web.rs +++ b/crates/infrastructure/src/web.rs @@ -1,12 +1,14 @@ -use crate::storage::data_storage; -use clap::Parser; use std::{ net::{IpAddr, SocketAddr}, path::PathBuf, sync::Arc, }; + +use clap::Parser; use tokio::runtime::Runtime; +use crate::storage::data_storage; + #[derive(Parser)] struct Args { #[clap(default_value = "127.0.0.1", help = "IP address", long)] @@ -22,5 +24,5 @@ pub fn run() { let db = Arc::new(data_storage(args.data_dir)); let rt = Runtime::new().expect("tokio runtime"); let addr = SocketAddr::from((args.bind, args.port)); - rt.block_on(cawr_web_server::run(db, addr)); + rt.block_on(cawr_web_server_warp::run(db, addr)); } diff --git a/crates/web-server/Cargo.toml b/crates/web-server-warp/Cargo.toml similarity index 95% rename from crates/web-server/Cargo.toml rename to crates/web-server-warp/Cargo.toml index c285e98..0e2ad7a 100644 --- a/crates/web-server/Cargo.toml +++ b/crates/web-server-warp/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cawr-web-server" +name = "cawr-web-server-warp" version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/web-server/src/handler/area_of_life/create.rs b/crates/web-server-warp/src/handler/area_of_life/create.rs similarity index 100% rename from crates/web-server/src/handler/area_of_life/create.rs rename to crates/web-server-warp/src/handler/area_of_life/create.rs diff --git a/crates/web-server/src/handler/area_of_life/delete.rs b/crates/web-server-warp/src/handler/area_of_life/delete.rs similarity index 100% rename from crates/web-server/src/handler/area_of_life/delete.rs rename to crates/web-server-warp/src/handler/area_of_life/delete.rs diff --git a/crates/web-server/src/handler/area_of_life/mod.rs b/crates/web-server-warp/src/handler/area_of_life/mod.rs similarity index 100% rename from crates/web-server/src/handler/area_of_life/mod.rs rename to crates/web-server-warp/src/handler/area_of_life/mod.rs diff --git a/crates/web-server/src/handler/area_of_life/read_all.rs b/crates/web-server-warp/src/handler/area_of_life/read_all.rs similarity index 100% rename from crates/web-server/src/handler/area_of_life/read_all.rs rename to crates/web-server-warp/src/handler/area_of_life/read_all.rs diff --git a/crates/web-server/src/handler/area_of_life/update.rs b/crates/web-server-warp/src/handler/area_of_life/update.rs similarity index 100% rename from crates/web-server/src/handler/area_of_life/update.rs rename to crates/web-server-warp/src/handler/area_of_life/update.rs diff --git a/crates/web-server/src/handler/error.rs b/crates/web-server-warp/src/handler/error.rs similarity index 100% rename from crates/web-server/src/handler/error.rs rename to crates/web-server-warp/src/handler/error.rs diff --git a/crates/web-server/src/handler/mod.rs b/crates/web-server-warp/src/handler/mod.rs similarity index 100% rename from crates/web-server/src/handler/mod.rs rename to crates/web-server-warp/src/handler/mod.rs diff --git a/crates/web-server/src/handler/thought/create.rs b/crates/web-server-warp/src/handler/thought/create.rs similarity index 100% rename from crates/web-server/src/handler/thought/create.rs rename to crates/web-server-warp/src/handler/thought/create.rs diff --git a/crates/web-server/src/handler/thought/delete.rs b/crates/web-server-warp/src/handler/thought/delete.rs similarity index 100% rename from crates/web-server/src/handler/thought/delete.rs rename to crates/web-server-warp/src/handler/thought/delete.rs diff --git a/crates/web-server/src/handler/thought/find_by_id.rs b/crates/web-server-warp/src/handler/thought/find_by_id.rs similarity index 100% rename from crates/web-server/src/handler/thought/find_by_id.rs rename to crates/web-server-warp/src/handler/thought/find_by_id.rs diff --git a/crates/web-server/src/handler/thought/mod.rs b/crates/web-server-warp/src/handler/thought/mod.rs similarity index 100% rename from crates/web-server/src/handler/thought/mod.rs rename to crates/web-server-warp/src/handler/thought/mod.rs diff --git a/crates/web-server/src/handler/thought/read_all.rs b/crates/web-server-warp/src/handler/thought/read_all.rs similarity index 100% rename from crates/web-server/src/handler/thought/read_all.rs rename to crates/web-server-warp/src/handler/thought/read_all.rs diff --git a/crates/web-server/src/handler/thought/update.rs b/crates/web-server-warp/src/handler/thought/update.rs similarity index 100% rename from crates/web-server/src/handler/thought/update.rs rename to crates/web-server-warp/src/handler/thought/update.rs diff --git a/crates/web-server/src/lib.rs b/crates/web-server-warp/src/lib.rs similarity index 100% rename from crates/web-server/src/lib.rs rename to crates/web-server-warp/src/lib.rs diff --git a/crates/web-server/src/route.rs b/crates/web-server-warp/src/route.rs similarity index 100% rename from crates/web-server/src/route.rs rename to crates/web-server-warp/src/route.rs diff --git a/crates/web-server/src/tests.rs b/crates/web-server-warp/src/tests.rs similarity index 100% rename from crates/web-server/src/tests.rs rename to crates/web-server-warp/src/tests.rs diff --git a/crates/web-server/src/webapp.rs b/crates/web-server-warp/src/webapp.rs similarity index 100% rename from crates/web-server/src/webapp.rs rename to crates/web-server-warp/src/webapp.rs