diff --git a/docker-compose.yml b/docker-compose.yml index 4e9dbc7..aaa5520 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -88,10 +88,10 @@ services: retries: 5 environment: - NODE_ENV=production - - VITE_API_URL=http://api:8000 + - VITE_API_URL=http://localhost:8000 restart: unless-stopped # NOTE: All services now run in Docker on the same network - # Frontend: http://api:8000 (Docker service name resolution) + # Frontend: http://localhost:8000 (Docker service name resolution) # Consumer: Still runs on host, connects to kafka:29092 volumes: diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e4224d6..fc2a987 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -28,8 +28,8 @@ interface Result { timestamp: string; } -// Default to Docker API service name (will be overridden by environment variable if needed) -const API_BASE_URL = 'http://api:8000'; +// Use localhost when browser accesses from host machine +const API_BASE_URL = 'http://localhost:8000'; const App: React.FC = () => { const [auth, setAuth] = useState({