From 109966b7e365423bce83b78004eb1c21b7892940 Mon Sep 17 00:00:00 2001 From: Melody Horn / boringcactus Date: Sun, 13 Jun 2021 10:19:13 -0600 Subject: break a few things out of folders --- src/http.rs | 1 + src/http/mod.rs | 1 - src/server.rs | 11 +++++++++++ src/server/mod.rs | 11 ----------- src/urls.rs | 5 +++++ src/urls/mod.rs | 5 ----- 6 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 src/http.rs delete mode 100644 src/http/mod.rs create mode 100644 src/server.rs delete mode 100644 src/server/mod.rs create mode 100644 src/urls.rs delete mode 100644 src/urls/mod.rs diff --git a/src/http.rs b/src/http.rs new file mode 100644 index 0000000..f8f1066 --- /dev/null +++ b/src/http.rs @@ -0,0 +1 @@ +pub use warp::{Filter, Reply, reply::Response}; diff --git a/src/http/mod.rs b/src/http/mod.rs deleted file mode 100644 index f8f1066..0000000 --- a/src/http/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub use warp::{Filter, Reply, reply::Response}; diff --git a/src/server.rs b/src/server.rs new file mode 100644 index 0000000..b275616 --- /dev/null +++ b/src/server.rs @@ -0,0 +1,11 @@ +use crate::urls::UrlMap; + +pub fn run_server(filter_stack: UrlMap) { + let server_task = warp::serve(filter_stack).run(([127, 0, 0, 1], 3030)); + + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(server_task) +} diff --git a/src/server/mod.rs b/src/server/mod.rs deleted file mode 100644 index b275616..0000000 --- a/src/server/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -use crate::urls::UrlMap; - -pub fn run_server(filter_stack: UrlMap) { - let server_task = warp::serve(filter_stack).run(([127, 0, 0, 1], 3030)); - - tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build() - .unwrap() - .block_on(server_task) -} diff --git a/src/urls.rs b/src/urls.rs new file mode 100644 index 0000000..45720b6 --- /dev/null +++ b/src/urls.rs @@ -0,0 +1,5 @@ +pub use warp::path; + +use crate::http::Response; + +pub type UrlMap = warp::filters::BoxedFilter<(Response,)>; diff --git a/src/urls/mod.rs b/src/urls/mod.rs deleted file mode 100644 index 45720b6..0000000 --- a/src/urls/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub use warp::path; - -use crate::http::Response; - -pub type UrlMap = warp::filters::BoxedFilter<(Response,)>; -- cgit v1.2.3