aboutsummaryrefslogtreecommitdiff
path: root/src/cli/run_server.rs
diff options
context:
space:
mode:
authorMelody Horn / boringcactus <melody@boringcactus.com>2021-06-13 11:03:27 -0600
committerMelody Horn / boringcactus <melody@boringcactus.com>2021-06-13 11:03:27 -0600
commitbb7da4934d4a5f0f5184ea382a122724d27d88a4 (patch)
tree91fe511f31a2194ba3cfa853c43f7871ae685792 /src/cli/run_server.rs
parent7447a411f0dc4c9eff4cfaf28c1171ca1b4be707 (diff)
downloadtosin-bb7da4934d4a5f0f5184ea382a122724d27d88a4.tar.gz
tosin-bb7da4934d4a5f0f5184ea382a122724d27d88a4.zip
power up CLI
Diffstat (limited to 'src/cli/run_server.rs')
-rw-r--r--src/cli/run_server.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cli/run_server.rs b/src/cli/run_server.rs
new file mode 100644
index 0000000..9e4d91c
--- /dev/null
+++ b/src/cli/run_server.rs
@@ -0,0 +1,20 @@
+use structopt::StructOpt;
+
+use crate::{Settings, UrlMap};
+
+#[derive(StructOpt)]
+pub struct RunServer {
+
+}
+
+impl RunServer {
+ pub fn execute(self, urls: UrlMap, _settings: Settings) {
+ let server_task = warp::serve(urls).run(([127, 0, 0, 1], 3030));
+
+ tokio::runtime::Builder::new_multi_thread()
+ .enable_all()
+ .build()
+ .unwrap()
+ .block_on(server_task)
+ }
+}