diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2020-01-28 21:18:50 -0500 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2020-01-28 21:18:50 -0500 |
commit | 94cbd545217d85f6e975131ee70a26194b7fdb3c (patch) | |
tree | 36e788b6554662db8e2fdcfd9358d9afc6d57384 /src/main.rs |
Initial rocket app framework
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..32333f1 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,36 @@ +#[macro_use] +extern crate clap; + +fn main() { + let matches = clap_app!(pjournal => + (version: "0.1") + (author: "KJ Ørbekk <kj@orbekk.com>") + (about: "Practice Journaling") + (@arg strava_client_secret: + --strava_client_secret + +required +takes_value + "Client secret for strava authentication") + (@arg strava_client_id: + --strava_client_id + +required +takes_value + "Client id for strava authentication") + (@arg base_url: + --base_url + +takes_value + "Endpoint for this web app") + ) + .get_matches(); + + let config = pjournal::Config { + client_id: matches + .value_of("strava_client_id") + .unwrap().to_string(), + client_secret: matches + .value_of("strava_client_secret") + .unwrap().to_string(), + base_url: matches + .value_of("base_url") + .unwrap_or("http://localhost:8000").to_string(), + }; + pjournal::start_server(config); +} |