diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-09-19 00:38:00 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-05-10 13:08:45 -0700 |
commit | a9b23947c49275a11765c8a752c154b98c69b531 (patch) | |
tree | 0c8bef53cfb66b81996721fcab92d90ec1c4376c /rust/fatcat-openapi/examples/server/main.rs | |
parent | 228a9245ea3680e11164f58367310406402d306b (diff) | |
download | fatcat-a9b23947c49275a11765c8a752c154b98c69b531.tar.gz fatcat-a9b23947c49275a11765c8a752c154b98c69b531.zip |
WIP: update rust codegen script
Only Cargo.toml project metadata updated.
Diffstat (limited to 'rust/fatcat-openapi/examples/server/main.rs')
-rw-r--r-- | rust/fatcat-openapi/examples/server/main.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rust/fatcat-openapi/examples/server/main.rs b/rust/fatcat-openapi/examples/server/main.rs new file mode 100644 index 00000000..af089c2f --- /dev/null +++ b/rust/fatcat-openapi/examples/server/main.rs @@ -0,0 +1,25 @@ +//! 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. +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"; + + hyper::rt::run(server::create(addr, matches.is_present("https"))); +} |