Parse http CLI args for HTTP server

This commit is contained in:
Paul Hauner
2019-05-28 13:50:51 +10:00
parent 2a04da8bf7
commit 3f27fd4edf
4 changed files with 53 additions and 14 deletions

View File

@@ -140,6 +140,19 @@ impl ClientConfig {
}
}
/* HTTP related arguments */
if args.is_present("http") {
config.http_conf.enabled = true;
}
if let Some(listen_address) = args.value_of("http-address") {
config.http_conf.listen_address = listen_address.to_string();
}
if let Some(listen_port) = args.value_of("http-port") {
config.http_conf.listen_port = listen_port.to_string();
}
match args.value_of("db") {
Some("disk") => config.db_type = DBType::Disk,
Some("memory") => config.db_type = DBType::Memory,