Skip to content

Commit

Permalink
Afford environment configuration of FQDN UI URL (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
William Welling authored Jan 11, 2023
1 parent 4e2e722 commit 07065df
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ In addition to having [Docker](https://docs.docker.com/) installed, a running [S
-e BASE_HREF=/ \
-e SERVICE_URL="http://localhost:9000" \
-e EMBED_URL="http://localhost:4201" \
-e UI_URL="http://localhost:4200" \
-e VIVO_URL="http://localhost:8080/vivo" \
-e VIVO_EDITOR_URL="http://localhost:8080/vivo_editor" \
-e COLLECT_SEARCH_STATS=true \
-e COLLECT_SEARCH_STATS=false \
scholars/angular
```

Expand Down
2 changes: 2 additions & 0 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function run() {

const SERVICE_URL = process.env.SERVICE_URL || 'http://localhost:9000';
const EMBED_URL = process.env.EMBED_URL || 'http://localhost:4201';
const UI_URL = process.env.UI_URL || 'http://localhost:4200';
const VIVO_URL = process.env.VIVO_URL || 'http://localhost:8080/vivo';
const VIVO_EDITOR_URL = process.env.VIVO_EDITOR_URL || 'http://localhost:8080/vivo_editor';

Expand All @@ -91,6 +92,7 @@ function run() {
baseHref: BASE_HREF,
serviceUrl: SERVICE_URL,
embedUrl: EMBED_URL,
uiUrl: UI_URL,
vivoUrl: VIVO_URL,
vivoEditorUrl: VIVO_EDITOR_URL,
collectSearchStats: COLLECT_SEARCH_STATS
Expand Down
1 change: 1 addition & 0 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface AppConfig {
baseHref: string;
serviceUrl: string;
embedUrl: string;
uiUrl: string;
vivoUrl: string;
vivoEditorUrl: string;
collectSearchStats: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface AppState {

export const reducers = (appConfig: AppConfig): ActionReducerMap<AppState> => {
const additionalContext = {
uiUrl: `//${appConfig.host}${appConfig.port !== 80 && appConfig.port !== 443 ? ':' + appConfig.port : ''}${appConfig.baseHref}`,
uiUrl: appConfig.uiUrl,
vivoUrl: appConfig.vivoUrl,
serviceUrl: appConfig.serviceUrl,
};
Expand Down
3 changes: 2 additions & 1 deletion src/assets/appConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"baseHref": "/",
"serviceUrl": "http://localhost:9000",
"embedUrl": "http://localhost:4201",
"uiUrl": "http://localhost:4200",
"vivoUrl": "http://localhost:8080/vivo",
"vivoEditorUrl": "http://localhost:8080/vivo_editor"
}
}
1 change: 1 addition & 0 deletions src/test.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const testAppConfig: AppConfig = {
baseHref: '/',
serviceUrl: 'http://localhost:9000',
embedUrl: 'http://localhost:4201',
uiUrl: 'http://localhost:4200',
vivoUrl: 'http://localhost:8080/vivo',
vivoEditorUrl: 'http://localhost:8080/vivo_editor',
collectSearchStats: false
Expand Down

0 comments on commit 07065df

Please sign in to comment.