Skip to content

Commit 2372a67

Browse files
committed
Fix production build API configuration
- Fix baseURL in production to use environment variable instead of window.location.origin - This prevents API calls from being intercepted by the static server - Update .env.production with proper configuration
1 parent 27a9b8a commit 2372a67

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

.env.production

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
REACT_APP_BASE_URL=http://localhost:9002
2-
# REACT_APP_BASE_URL=https://9ee32ecaf5a1.ngrok.app
2+
REACT_APP_WALLET_BASE_URL=http://localhost:9003
33
REACT_APP_ASSETS_BUCKET=http://localhost
4+
REACT_APP_DEMO_MODE=false
45

5-
# more info https://create-react-app.dev/docs/advanced-configuration
6+
# More info https://create-react-app.dev/docs/advanced-configuration
67
ESLINT_NO_DEV_ERRORS=true
78
TSC_COMPILE_ON_ERROR=true

src/config/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const config = {
33
baseURL: process.env.REACT_APP_DEMO_MODE === 'true'
44
? 'http://localhost:10002'
55
: process.env.NODE_ENV === 'production'
6-
? window.location.origin || 'http://localhost:9002'
6+
? process.env.REACT_APP_BASE_URL || 'http://localhost:9002'
77
: process.env.REACT_APP_BASE_URL || 'http://localhost:9002',
88
isDemoMode: process.env.REACT_APP_DEMO_MODE === 'true',
99
walletBaseURL: process.env.REACT_APP_WALLET_BASE_URL?.trim() || 'http://localhost:9003',

0 commit comments

Comments
 (0)