Skip to content

Commit

Permalink
add base path + url
Browse files Browse the repository at this point in the history
  • Loading branch information
joris committed Jan 15, 2024
1 parent 70154cb commit 717542f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
branches:
- main
- dev
- feat/pipeline

env:
ARTIFACTORY_HOST: europe-west4-docker.pkg.dev
Expand Down
6 changes: 3 additions & 3 deletions agent_api_rest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ use std::env;
pub const AGGREGATE_ID: &str = "agg-id-F39A0C";

pub fn app(state: ApplicationState<IssuanceData, IssuanceDataView>) -> Router {
let prefix: Option<String> = env::var_os("AGENT_APPLICATION_BASE_PATH").map(|os| {
let base_path: Option<String> = env::var_os("AGENT_APPLICATION_BASE_PATH").map(|os| {
println!("AGENT_APPLICATION_BASE_PATH can't start or end with '/'");
os.into_string().expect("Can't parse AGENT_APPLICATION_BASE_PATH")
});

let path = |suffix: &str| -> String {
if let Some(prefix) = &prefix {
format!("/{}{}", prefix, suffix)
if let Some(base_path) = &base_path {
format!("/{}{}", base_path, suffix)
} else {
suffix.to_string()
}
Expand Down

0 comments on commit 717542f

Please sign in to comment.