feat: implement server configuration with address and port options

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-15 17:55:13 -03:00
parent b9d79d2fe1
commit 29ce003fa8
3 changed files with 41 additions and 20 deletions

View File

@@ -20,20 +20,10 @@ use utoipa::ToSchema;
#[derive(Debug, Clone)]
pub struct ServerConfig {
pub address: String,
pub port: Option<u16>,
pub password: Option<String>,
}
impl FromStr for ServerConfig {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(ServerConfig {
address: s.to_string(),
password: None,
})
}
}
#[derive(Clone)]
pub struct AppState {
pub db: Arc<Mutex<rusqlite::Connection>>,