Add command line parameters

This commit is contained in:
Valentin Brandl 2019-07-27 17:13:11 +02:00
parent 6d82f3fef8
commit 8c3f870321
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

20
backend/src/config.rs Normal file
View File

@ -0,0 +1,20 @@
use std::net::IpAddr;
#[derive(StructOpt)]
pub(crate) struct Opt {
#[structopt(short = "p", long = "port", default_value = "8080")]
/// Port to listen on
pub(crate) port: u16,
#[structopt(short = "i", long = "interface", default_value = "0.0.0.0")]
/// Interface to listen on
pub(crate) interface: IpAddr,
#[structopt(short = "w", long = "workers", default_value = "4")]
/// Number of worker threads
pub(crate) workers: usize,
#[structopt(long = "gh-id")]
/// GitHub OAuth client ID
pub(crate) github_id: Option<String>,
#[structopt(long = "gh-secret")]
/// GitHub OAuth client secret
pub(crate) github_secret: Option<String>,
}