Add base kubernetes support 2
This commit is contained in:
@@ -28,10 +28,12 @@ export default defineConfig({
|
||||
},
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: process.env.NODE_ENV === 'development'
|
||||
? 'http://gateway:8000' // Use internal service name in Kubernetes
|
||||
: 'http://localhost:8000',
|
||||
target: process.env.VITE_API_URL ||
|
||||
(process.env.NODE_ENV === 'development' && process.env.KUBERNETES_SERVICE_HOST
|
||||
? 'http://gateway-service:8000' // Kubernetes internal service
|
||||
: 'http://localhost:8000'), // Local development
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user