Frontend is still sending requests to localhost:3000 instead of https://uia-bobinsight-api.pinont.me
✅ DONE - Created apps/frontend/.env with:
VITE_API_BASE_URL=https://uia-bobinsight-api.pinont.me✅ DONE - Updated CSP in:
apps/frontend/index.html(for dev server)apps/frontend/nginx.conf(for production Docker)
Added https://uia-bobinsight-api.pinont.me and https://*.pinont.me to allowed connect-src domains.
IMPORTANT: You MUST restart the dev server for changes to take effect:
# Stop the current frontend server (Ctrl+C)
# Then restart it:
npm run dev:frontendOr if running both servers together:
# Stop all servers (Ctrl+C)
# Then restart:
npm run devIf you're running the Docker production build, you need to rebuild:
# Stop containers
docker-compose down
# Rebuild frontend with new CSP
docker-compose build frontend
# Start again
docker-compose up -d✅ DONE - Backend already configured to accept:
http://localhost:5173(development)https://uia-bobinsight.pinont.me(production frontend)https://*.pinont.me(wildcard for all subdomains)
After restarting the server:
- Open browser DevTools (F12)
- Right-click the refresh button
- Select "Empty Cache and Hard Reload"
Or use Incognito/Private mode to test with a clean slate.
Open browser console and check for:
[API] POST https://uia-bobinsight-api.pinont.me/api/analyze
Instead of:
[API] POST http://localhost:3000/api/analyze
- Environment variables in wrong location: Vite reads
.envfromapps/frontend/, not from root - Server not restarted: Vite caches environment variables on startup
- Browser cache: Old API URL may be cached in browser
-
apps/frontend/.envexists withVITE_API_BASE_URL=https://uia-bobinsight-api.pinont.me - Frontend dev server restarted
- Browser cache cleared
- Console shows requests going to
https://uia-bobinsight-api.pinont.me - No CORS errors in console
Add this temporarily to apps/frontend/src/services/apiClient.ts after line 24:
console.log('API_BASE_URL:', API_BASE_URL);You should see:
API_BASE_URL: https://uia-bobinsight-api.pinont.me
If you see http://localhost:3000, the .env file is not being read.
Test the backend directly:
curl https://uia-bobinsight-api.pinont.me/healthShould return:
{"status":"ok","timestamp":"..."}Check if backend is sending correct CORS headers:
curl -H "Origin: https://uia-bobinsight.pinont.me" \
-H "Access-Control-Request-Method: POST" \
-H "Access-Control-Request-Headers: Content-Type" \
-X OPTIONS \
https://uia-bobinsight-api.pinont.me/api/analyze -vLook for:
Access-Control-Allow-Origin: https://uia-bobinsight.pinont.me
For production builds (not dev server):
-
Build with environment variable:
cd apps/frontend VITE_API_BASE_URL=https://uia-bobinsight-api.pinont.me npm run build -
Or set in deployment platform:
- Vercel: Add
VITE_API_BASE_URLin Environment Variables - Netlify: Add in Site Settings > Environment Variables
- Docker: Pass via
docker-compose.ymlor--envflag
- Vercel: Add
See PRODUCTION_DEPLOYMENT.md for complete deployment guide.