Split out socket config and switch back to toml crate

basic-toml does not support externally-tagged enum yet.

See: https://github.com/dtolnay/basic-toml/issues/8
This commit is contained in:
oxalica 2024-09-09 01:26:46 -04:00
parent 4f0f1405dc
commit c5263c607c
7 changed files with 92 additions and 48 deletions

View file

@ -37,13 +37,7 @@ fn server() -> Server {
let listener = TcpListener::from_std(listener).unwrap();
// TODO: Testing config is hard to build because it does have a `Default` impl.
let config = basic_toml::from_str(&format!(
r#"
listen = "" # TODO: unused
base_url = "http://{LOCALHOST}:{port}"
"#
))
.unwrap();
let config = toml::from_str(&format!(r#"base_url="http://{LOCALHOST}:{port}""#)).unwrap();
let st = AppState::new(db, config);
let router = blahd::router(Arc::new(st));