Spaces:
Running
Running
A newer version of the Gradio SDK is available:
6.9.0
Run Test UI - QUICK START
The Problem
Opening test_chat_ui.html directly (file://) causes CORS errors because browsers send origin: null.
The Solution - Serve it via HTTP
Option 1: Using Python (Recommended)
In a NEW terminal (keep the backend server running in the first one):
cd C:\Users\Destiny Ebuka\Desktop\python-Backend\lojiz-backend\AIDA
python -m http.server 8080
Then open in browser: http://localhost:8080/test_chat_ui.html
Option 2: Using VS Code Live Server
- Install "Live Server" extension in VS Code
- Right-click
test_chat_ui.html - Select "Open with Live Server"
Full Testing Steps
Terminal 1 - Backend Server
cd C:\Users\Destiny Ebuka\Desktop\python-Backend\lojiz-backend\AIDA
python -m uvicorn main:app --reload
Terminal 2 - Test UI Server
cd C:\Users\Destiny Ebuka\Desktop\python-Backend\lojiz-backend\AIDA
python -m http.server 8080
Browser
Open: http://localhost:8080/test_chat_ui.html
✅ Now CORS will work because:
- UI runs on
http://localhost:8080 - API runs on
http://localhost:8000 - Both are proper HTTP origins (not
null) - CORS middleware allows localhost
Test the Login
- Enter credentials
- Click "Login"
- Check Debug Output - should see successful response with JWT
- Check server logs - should see:
INFO: OPTIONS /api/auth/login HTTP/1.1" 200 OK INFO: POST /api/auth/login HTTP/1.1" 200 OK
That's it! 🚀