mirror of
https://github.com/house-of-vanity/khm.git
synced 2025-08-21 22:27:14 +00:00
Added web ui
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -1,6 +1,7 @@
|
||||
mod client;
|
||||
mod db;
|
||||
mod server;
|
||||
mod web;
|
||||
|
||||
use clap::Parser;
|
||||
use env_logger;
|
||||
@@ -119,6 +120,19 @@ async fn main() -> std::io::Result<()> {
|
||||
|
||||
let args = Args::parse();
|
||||
|
||||
// Check if we have the minimum required arguments
|
||||
if !args.server && args.host.is_none() {
|
||||
// Neither server mode nor client mode properly configured
|
||||
eprintln!("Error: You must specify either server mode (--server) or client mode (--host)");
|
||||
eprintln!();
|
||||
eprintln!("Examples:");
|
||||
eprintln!(" Server mode: {} --server --db-user admin --db-password pass --flows work,home", env!("CARGO_PKG_NAME"));
|
||||
eprintln!(" Client mode: {} --host https://khm.example.com/work", env!("CARGO_PKG_NAME"));
|
||||
eprintln!();
|
||||
eprintln!("Use --help for more information.");
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
if args.server {
|
||||
info!("Running in server mode");
|
||||
if let Err(e) = server::run_server(args).await {
|
||||
|
Reference in New Issue
Block a user