feat: add command line arguments

This commit is contained in:
Alex Wellnitz
2024-02-16 20:55:26 +01:00
parent 45c1aa471a
commit 41824bd04b
8 changed files with 157 additions and 3 deletions

16
src/types/config.rs Normal file
View File

@@ -0,0 +1,16 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Config {
http_addr: String,
database_path: String,
}
impl Config {
pub fn new() -> Config {
Config {
http_addr: String::from("127.0.0.1:4000"),
database_path: String::from("/tmp/rustysearch.db"),
}
}
}

View File

@@ -1 +1,2 @@
pub mod app_state;
pub mod app_state;
pub mod config;