aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src
diff options
context:
space:
mode:
Diffstat (limited to 'planetwars-server/src')
-rw-r--r--planetwars-server/src/lib.rs3
-rw-r--r--planetwars-server/src/modules/bot_api.rs5
2 files changed, 8 insertions, 0 deletions
diff --git a/planetwars-server/src/lib.rs b/planetwars-server/src/lib.rs
index c8585f8..050048c 100644
--- a/planetwars-server/src/lib.rs
+++ b/planetwars-server/src/lib.rs
@@ -45,6 +45,9 @@ pub struct GlobalConfig {
/// this will be used when running bots
pub container_registry_url: String,
+ /// webserver root url, used to construct links
+ pub root_url: String,
+
/// directory where bot code will be stored
pub bots_directory: String,
/// directory where match logs will be stored
diff --git a/planetwars-server/src/modules/bot_api.rs b/planetwars-server/src/modules/bot_api.rs
index cb12275..3bc002c 100644
--- a/planetwars-server/src/modules/bot_api.rs
+++ b/planetwars-server/src/modules/bot_api.rs
@@ -135,6 +135,11 @@ impl pb::bot_api_service_server::BotApiService for BotApiServer {
Ok(Response::new(pb::CreatedMatch {
match_id: created_match.base.id,
player_key,
+ // TODO: can we avoid hardcoding this?
+ match_url: format!(
+ "{}/matches/{}",
+ self.runner_config.root_url, created_match.base.id
+ ),
}))
}
}