Skip to content

Commit

Permalink
add configuration of allication server url
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixTJDietrich committed Aug 13, 2024
1 parent ee8a7fe commit a7c48a0
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 8 deletions.
8 changes: 7 additions & 1 deletion webapp/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"
Expand Down
94 changes: 92 additions & 2 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@storybook/blocks": "8.2.6",
"@storybook/test": "8.2.6",
"@types/jasmine": "5.1.4",
"@types/node": "^22.2.0",
"@typescript-eslint/eslint-plugin": "8.0.0",
"@typescript-eslint/parser": "8.0.0",
"chromatic": "11.5.6",
Expand Down
9 changes: 5 additions & 4 deletions webapp/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ import { provideAnimationsAsync } from '@angular/platform-browser/animations/asy
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { provideAngularQuery, QueryClient } from '@tanstack/angular-query-experimental';
import { LucideAngularModule, Home, Sun, Moon, Hammer } from 'lucide-angular';
import { routes } from './app.routes';
import { BASE_PATH } from './core/modules/openapi';
import { APPLICATION_SERVER_URL } from 'environments/environment';
import { BASE_PATH } from 'app/core/modules/openapi';
import { routes } from 'app/app.routes';

export const appConfig: ApplicationConfig = {
providers: [
provideExperimentalZonelessChangeDetection(),
provideRouter(routes),
provideAngularQuery(new QueryClient()),
{ provide: BASE_PATH, useValue: 'http://localhost:8080' },
provideHttpClient(withInterceptorsFromDi()),
provideAnimationsAsync(),
importProvidersFrom(LucideAngularModule.pick({ Home, Sun, Moon, Hammer }))
importProvidersFrom(LucideAngularModule.pick({ Home, Sun, Moon, Hammer })),
{ provide: BASE_PATH, useValue: APPLICATION_SERVER_URL }
]
};
1 change: 1 addition & 0 deletions webapp/src/environments/environment.development.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const APPLICATION_SERVER_URL = 'http://localhost:8080';
1 change: 1 addition & 0 deletions webapp/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const APPLICATION_SERVER_URL = process.env['APPLICATION_SERVER_URL'];
2 changes: 1 addition & 1 deletion webapp/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
"types": ["node"],
},
"files": [
"src/main.ts"
Expand Down

0 comments on commit a7c48a0

Please sign in to comment.