aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorMelody Horn / boringcactus <melody@boringcactus.com>2021-06-12 23:24:33 -0600
committerMelody Horn / boringcactus <melody@boringcactus.com>2021-06-12 23:24:33 -0600
commit4c8940569e5729213b7eee6f3d5be39b745b697b (patch)
tree20935676f7a14ad12752ec98b65db9f067fba239 /src/server
parent582124d59afa438e2cb88cc024d6b19232236e1e (diff)
downloadtosin-4c8940569e5729213b7eee6f3d5be39b745b697b.tar.gz
tosin-4c8940569e5729213b7eee6f3d5be39b745b697b.zip
actually implement the easy example
Diffstat (limited to 'src/server')
-rw-r--r--src/server/mod.rs11
1 files changed, 11 insertions, 0 deletions
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)
+}