use std::path::PathBuf;
use anyhow::Result;
use clap::Args;
use crate::api;
#[derive(Args)]
pub struct ServeArgs {
#[arg(short, long, default_value = "data/variants.db")]
pub db: PathBuf,
#[arg(long, default_value = "0.0.0.0")]
pub host: String,
#[arg(short, long, default_value = "3042")]
pub port: u16,
}
impl ServeArgs {
pub async fn run(self) -> Result<()> {
api::serve(self.db, &self.host, self.port).await
}
}