From 19c582a3cf1c42e9c75170650ccd141eda903479 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 9 Feb 2021 18:57:00 -0800 Subject: move source code to top-level directory --- fatcat-openapi/examples/server/main.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 fatcat-openapi/examples/server/main.rs (limited to 'fatcat-openapi/examples/server/main.rs') diff --git a/fatcat-openapi/examples/server/main.rs b/fatcat-openapi/examples/server/main.rs new file mode 100644 index 0000000..5488dc6 --- /dev/null +++ b/fatcat-openapi/examples/server/main.rs @@ -0,0 +1,26 @@ +//! Main binary entry point for fatcat_openapi implementation. + +#![allow(missing_docs)] + +use clap::{App, Arg}; + +mod server; + +/// Create custom server, wire it to the autogenerated router, +/// and pass it to the web server. +#[tokio::main] +async fn main() { + env_logger::init(); + + let matches = App::new("server") + .arg( + Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not"), + ) + .get_matches(); + + let addr = "127.0.0.1:8080"; + + server::create(addr, matches.is_present("https")).await; +} -- cgit v1.2.3