From 4c8940569e5729213b7eee6f3d5be39b745b697b Mon Sep 17 00:00:00 2001 From: Melody Horn / boringcactus Date: Sat, 12 Jun 2021 23:24:33 -0600 Subject: actually implement the easy example --- src/server/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/server/mod.rs (limited to 'src/server') diff --git a/src/server/mod.rs b/src/server/mod.rs new file mode 100644 index 0000000..b275616 --- /dev/null +++ b/src/server/mod.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) +} -- cgit v1.2.3