diff --git a/src/main.rs b/src/main.rs index 35cbfa3..707754c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,6 +40,12 @@ macro_rules! api_base_3 { #[derive(Serialize, Deserialize, Debug, Clone)] pub(crate) struct ConfigToml { auth: AuthenticationTokens, + port: PortConfig, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub(crate) struct PortConfig { + default: u16, } #[derive(Serialize, Deserialize, Debug, Clone)] @@ -270,7 +276,7 @@ async fn main() -> Result<()> { .config(swagger_config.clone()), ) }) - .bind((Ipv6Addr::UNSPECIFIED, 8080)).expect("Port or IP already occupied") + .bind((Ipv6Addr::UNSPECIFIED, config.port.default)).expect("Port or IP already occupied") .run(); let server_thread = tokio::spawn(async {