fix: remove hardcoded port, require VITE_API_URL env var

- Remove default localhost:8080 fallback from API_BASE_URL
- Make VITE_API_URL required for proper functionality
- Update .env.example to clarify required configuration
- Ensure no hardcoded ports exist in frontend
This commit is contained in:
Chris Scott committed 2025-11-24 00:19:36 -05:00
1 parent 1555a6d641
commit ecaf1609c3
3 files changed
+4 -9

No files matched your search

+2 -2
View File
@@ -44,9 +44,9 @@ MAX_UPLOAD_SIZE_MB=50
DEBUG=false
# ============================================
# Frontend Configuration (for development)
# Frontend Configuration (REQUIRED)
# ============================================
# Backend API URL - frontend connects to this
# Note: In development, Vite proxies /api requests to the backend
# Must include full URL with port (e.g., http://localhost:8080)
VITE_API_URL=http://localhost:8080
+1 -1
View File
@@ -1,4 +1,4 @@
export const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8080'
export const API_BASE_URL = import.meta.env.VITE_API_URL
export const OPENCODE_API_ENDPOINT = import.meta.env.VITE_API_URL
? `${import.meta.env.VITE_API_URL}/api/opencode`
+1 -6
View File
@@ -22,12 +22,7 @@ export default defineConfig({
target: process.env.VITE_API_URL,
changeOrigin: true,
},
} : {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
},
},
} : undefined,
},
build: {
assetsInlineLimit: 4096,