Take config path as input

This commit is contained in:
Andras Schmelczer 2025-03-24 21:57:56 +00:00
parent 958af89116
commit baba8f82bf
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
6 changed files with 56 additions and 9 deletions

View file

@ -1,4 +1,4 @@
use std::sync::Arc;
use std::{ffi::OsString, sync::Arc};
use aide::{
axum::{
@ -48,11 +48,11 @@ mod requests;
mod responses;
mod update_document;
pub async fn create_server() -> Result<()> {
pub async fn create_server(config_path: Option<OsString>) -> Result<()> {
aide::r#gen::on_error(|err| error!("{err}"));
aide::r#gen::extract_schemas(true);
let app_state = AppState::try_new()
let app_state = AppState::try_new(config_path)
.await
.context("Failed to initialise app state")?;