diff --git a/src/app/user_config.rs b/src/app/user_config.rs index e2554ea..294e8c3 100644 --- a/src/app/user_config.rs +++ b/src/app/user_config.rs @@ -1,10 +1,12 @@ use serde::Deserialize; use twitch_api2::twitch_oauth2::{ClientId, ClientSecret}; +use std::net::IpAddr; #[derive(Deserialize)] pub struct UserConfig { pub twitch: Twitch, pub bot: Bot, + pub web: Web, } #[derive(Deserialize)] @@ -18,3 +20,9 @@ pub struct Twitch { pub struct Bot { pub access_token: String, } + +#[derive(Deserialize)] +pub struct Web { + pub address: IpAddr, + pub port: u16, +} diff --git a/src/app/web.rs b/src/app/web.rs index b912de6..b81ef3c 100644 --- a/src/app/web.rs +++ b/src/app/web.rs @@ -36,7 +36,7 @@ pub async fn start_web(state: Arc) { let routes = authed.or(unauthed).recover(handle_rejection); warp::serve(routes) - .run(([0, 0, 0, 0], 8000)) + .run((state.user_config.web.address, state.user_config.web.port)) .await; }