From f5fc6a02fbdd48a66582b59078afa3202873eadc Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 28 Apr 2024 19:45:54 +0200 Subject: configure port --- src/main.rs | 4 ++++ src/state.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 8a20982..6887fe7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,6 +32,10 @@ async fn main() { let state = Logic::new(config); let _ = rocket::build() + .configure(rocket::Config { + port: state.config.port, + ..Default::default() + }) .attach(AdHoc::on_response("set server header", |_req, res| { res.set_header(Header::new("server", "meta adservices")); Box::pin(async {}) diff --git a/src/state.rs b/src/state.rs index 4de21b4..368e76b 100644 --- a/src/state.rs +++ b/src/state.rs @@ -16,6 +16,7 @@ pub struct Config { impression_weight_falloff: f64, pub image_base: PathBuf, database_path: PathBuf, + pub port: u16, pub ads: HashMap, } -- cgit v1.2.3-70-g09d2