Allow Axios to automatically use the correct base URL depending on whether the app is running locally or deployed on Vercel. Frontend - [ ] Set up environment variables for the backend URL (VITE_BACKEND_URL) in both local .env file and Vercel project settings. - [ ] Ensure Axios is initialized with the base URL from the environment variable. - [ ] Implement a fallback strategy for when the environment variable is not defined. Test Axios requests locally and on Vercel to confirm everything works correctly across environments. Backend - [ ] Set up environment variables for the frontend origin (FRONTEND_URL) in both local .env and Vercel dashboard. - [ ] Update CORS settings to allow the appropriate frontend origin depending on the environment. - [ ] Confirm that API requests from both local and deployed frontends are accepted without CORS or credential issues.
Allow Axios to automatically use the correct base URL depending on whether the app is running locally or deployed on Vercel.
Frontend
Set up environment variables for the backend URL (VITE_BACKEND_URL) in both local .env file and Vercel project settings.
Ensure Axios is initialized with the base URL from the environment variable.
Implement a fallback strategy for when the environment variable is not defined.
Test Axios requests locally and on Vercel to confirm everything works correctly across environments.
Backend
Set up environment variables for the frontend origin (FRONTEND_URL) in both local .env and Vercel dashboard.
Update CORS settings to allow the appropriate frontend origin depending on the environment.
Confirm that API requests from both local and deployed frontends are accepted without CORS or credential issues.