File tree Expand file tree Collapse file tree
host/WriteFluency.AppHost/aspirate-overlays Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ resources:
22 - ../aspirate-output
33 - letsencrypt.yaml
44 - ingress.yaml
5- - wf-webapp/configmap.yaml
65
76images :
87 - name : ghcr.io/mateus-mannes/wf-api
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ import { serverRoutes } from './app.routes.server';
55import { provideApi } from 'src/api/listen-and-write/provide-api' ;
66import { environment } from '../enviroments/enviroment' ;
77
8- // Server-side API URL - uses environment variables if available (for Kubernetes internal service)
8+ // Server-side API URL - uses Aspire service discovery in Kubernetes
9+ // Aspire sets: services__wf-api__apihttp__0=wf-api:5000
910// Falls back to build-time environment for local development
10- const serverApiUrl = process . env [ 'API_URL' ] || environment . apiUrl ;
11+ const aspireApiUrl = process . env [ 'services__wf-api__apihttp__0' ] ;
12+ const serverApiUrl = aspireApiUrl ? `http://${ aspireApiUrl } ` : environment . apiUrl ;
1113
1214console . log ( `[SSR] Using API URL: ${ serverApiUrl } ` ) ;
1315
Original file line number Diff line number Diff line change @@ -10,15 +10,14 @@ import { environment } from './enviroments/enviroment';
1010
1111const browserDistFolder = join ( import . meta. dirname , '../browser' ) ;
1212
13- // Use environment variables for SSR, fallback to build-time environment
14- // This allows the container to override API URLs without rebuilding
15- // In Kubernetes: API_URL=http://wf-api:5000 (internal service)
16- // In local dev: Uses environment.apiUrl (http://localhost:5000)
17- const apiUrl = process . env [ 'API_URL' ] || environment . apiUrl ;
18- const minioUrl = process . env [ 'MINIO_URL' ] || environment . minioUrl ;
13+ // Use Aspire service discovery environment variables for SSR
14+ // Aspire sets: services__wf-api__apihttp__0=wf-api:5000
15+ // In Kubernetes: Uses Aspire service discovery
16+ // In local dev: Falls back to environment.apiUrl
17+ const aspireApiUrl = process . env [ 'services__wf-api__apihttp__0' ] ;
18+ const apiUrl = aspireApiUrl ? `http:// ${ aspireApiUrl } ` : environment . apiUrl ;
1919
2020console . log ( `[Server] Using API URL: ${ apiUrl } ` ) ;
21- console . log ( `[Server] Using MinIO URL: ${ minioUrl } ` ) ;
2221
2322const app = express ( ) ;
2423const angularApp = new AngularNodeAppEngine ( ) ;
You can’t perform that action at this time.
0 commit comments