File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,19 @@ function generateEnvironmentFile() {
1010 hydrateProcessEnv ( ) ;
1111
1212 const backendPort = determineBackendPort ( ) ;
13- const resolvedApiBase = process . env . API_BASE_URL || ( backendPort ? `http://localhost:${ backendPort } /api/` : 'http://localhost:3000/api/' ) ;
13+
14+ let resolvedApiBase ;
15+ // When running locally, we must prioritize the dynamic backend port over any
16+ // value from a .env file, which likely contains the default port.
17+ if ( backendPort ) {
18+ resolvedApiBase = `http://localhost:${ backendPort } /api/` ;
19+ }
20+ // For other cases (like CI builds), use the environment variable or a fallback.
21+ else {
22+ resolvedApiBase =
23+ process . env . API_BASE_URL || 'http://localhost:3000/api/' ;
24+ }
25+
1426 const frontPort = determineFrontendPort ( ) ;
1527 const resolvedUiUrl = process . env . UI_URL || `http://localhost:${ frontPort ?? '4200' } /` ;
1628
You can’t perform that action at this time.
0 commit comments