feat: add Node.js Express server for IAP and backend auth

Replace Python http.server with Express to handle:
- Large IAP JWT headers that caused 500 errors
- API request proxying with GCP identity tokens
- Static React build serving with SPA fallback

Update api.ts to use relative URLs in production for proxy routing.
This commit is contained in:
Danny
2026-01-16 14:33:26 -06:00
parent 5eb6f9ea31
commit 5195901f01
3 changed files with 74 additions and 16 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
import type { ChatMode } from '@/types/chat'
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000'
// In production, use relative URL to route through the proxy server
// For local development, set VITE_API_URL=http://localhost:8000 in .env
const API_BASE_URL = import.meta.env.VITE_API_URL || '/api'
const API_ENDPOINT = import.meta.env.VITE_API_ENDPOINT || '/chat/stream'
const USE_MOCK_DATA = false // Set to true to use mock data for testing