feat: support cross-origin deployment with VITE_API_BASE_URL
- Set VITE_API_BASE_URL=https://opinion-api.moreminimore.com for frontend-backend split deployment - Vite proxy also uses API_BACKEND_URL env var as target - Falls back to same-origin proxy for local dev
This commit is contained in:
@@ -18,9 +18,9 @@ export default defineConfig({
|
||||
allowedHosts: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:5001',
|
||||
target: process.env.API_BACKEND_URL || 'http://localhost:5001',
|
||||
changeOrigin: true,
|
||||
secure: false
|
||||
secure: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user