This commit is contained in:
Andreas Knuth 2026-02-06 12:28:30 -06:00
parent 91bcf3c2ed
commit 33ea71dc12
2 changed files with 6 additions and 8 deletions

View File

@ -1,7 +1,8 @@
import { RenderMode, ServerRoute } from '@angular/ssr';
export const serverRoutes: ServerRoute[] = [
{ path: 'home', renderMode: RenderMode.Prerender },
// WICHTIG: home auf Server stellen!
{ path: 'home', renderMode: RenderMode.Server },
{ path: 'terms-of-use', renderMode: RenderMode.Prerender },
{ path: 'privacy-statement', renderMode: RenderMode.Prerender },
{ path: '**', renderMode: RenderMode.Server }

View File

@ -1,23 +1,20 @@
// SSR-safe: check if window exists
// Im Browser nehmen wir den aktuellen Host (z.B. localhost).
// Auf dem Server (SSR in Docker) nehmen wir 'bizmatch-app' (der Name des Backend-Containers).
const hostname = typeof window !== 'undefined' ? window.location.hostname : 'bizmatch-app';
const isBrowser = typeof window !== 'undefined';
const isBrowser = typeof window !== 'undefined' && window.navigator.userAgent !== 'node';
const hostname = isBrowser ? window.location.hostname : 'bizmatch-app';
// WICHTIG: Port anpassen!
// 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).
const port = 3001;
const protocol = typeof window !== 'undefined' ? 'http' : 'http'; // Intern im Docker meist http
export const environment_base = {
// apiBaseUrl: 'http://localhost:3000',
// GETTER FUNCTION für die API URL (besser als statischer String für diesen Fall)
get apiBaseUrl() {
if (isBrowser) {
// Browser: Nutze die öffentliche HTTPS API
return 'https://api.bizmatch.net';
} else {
// SSR (Docker): Nutze die interne HTTP Verbindung direkt zum Backend
// WICHTIG: http (nicht https) und Port 3001
// SSR (Docker) nutzt interne Verbindung
return 'http://bizmatch-app:3001';
}
},