This commit is contained in:
Andreas Knuth 2026-02-06 18:57:41 -06:00
parent 2d293d8b12
commit a545b84f6c
1 changed files with 6 additions and 9 deletions

View File

@ -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',