variable
This commit is contained in:
parent
2d293d8b12
commit
a545b84f6c
|
|
@ -3,21 +3,18 @@
|
||||||
// Auf dem Server (SSR in Docker) nehmen wir 'bizmatch-app' (der Name des Backend-Containers).
|
// Auf dem Server (SSR in Docker) nehmen wir 'bizmatch-app' (der Name des Backend-Containers).
|
||||||
const isBrowser = typeof window !== 'undefined' && window.navigator.userAgent !== 'node';
|
const isBrowser = typeof window !== 'undefined' && window.navigator.userAgent !== 'node';
|
||||||
const hostname = isBrowser ? window.location.hostname : 'bizmatch-app';
|
const hostname = isBrowser ? window.location.hostname : 'bizmatch-app';
|
||||||
|
// Im Server-Modus nutzen wir den internen Docker-Namen
|
||||||
|
const internalUrl = 'http://bizmatch-app:3001';
|
||||||
|
// Im Browser-Modus die öffentliche URL
|
||||||
|
const publicUrl = 'https://api.bizmatch.net';
|
||||||
|
const calculatedApiBaseUrl = isBrowser ? publicUrl : internalUrl;
|
||||||
// WICHTIG: Port anpassen!
|
// WICHTIG: Port anpassen!
|
||||||
// Lokal läuft das Backend auf 3001. Im Docker Container auch auf 3001.
|
// Lokal läuft das Backend auf 3001. Im Docker Container auch auf 3001.
|
||||||
// Deine alte Config hatte hier :4200 stehen, das war falsch (das ist das Frontend).
|
// Deine alte Config hatte hier :4200 stehen, das war falsch (das ist das Frontend).
|
||||||
export const environment_base = {
|
export const environment_base = {
|
||||||
// apiBaseUrl: 'http://localhost:3000',
|
// apiBaseUrl: 'http://localhost:3000',
|
||||||
// GETTER FUNCTION für die API URL (besser als statischer String für diesen Fall)
|
// GETTER FUNCTION für die API URL (besser als statischer String für diesen Fall)
|
||||||
get apiBaseUrl() {
|
apiBaseUrl: calculatedApiBaseUrl,
|
||||||
if (isBrowser) {
|
|
||||||
return 'https://api.bizmatch.net';
|
|
||||||
} else {
|
|
||||||
// SSR (Docker) nutzt interne Verbindung
|
|
||||||
return 'http://bizmatch-app:3001';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
imageBaseUrl: 'https://dev.bizmatch.net',
|
imageBaseUrl: 'https://dev.bizmatch.net',
|
||||||
buildVersion: '<BUILD_VERSION>',
|
buildVersion: '<BUILD_VERSION>',
|
||||||
mailinfoUrl: 'https://dev.bizmatch.net',
|
mailinfoUrl: 'https://dev.bizmatch.net',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue