Skip to content

Proxy API requests through Vite dev server and remove CORS#374

Open
somethingnew2-0 wants to merge 1 commit intomainfrom
proxy-api-requests-remove-cors
Open

Proxy API requests through Vite dev server and remove CORS#374
somethingnew2-0 wants to merge 1 commit intomainfrom
proxy-api-requests-remove-cors

Conversation

@somethingnew2-0
Copy link
Collaborator

In development, Vite now proxies /api requests to the Flask backend, so both frontend and backend are accessed from the same origin. This eliminates the need for CORS, which was only configured for development.

  • Add /api proxy to Vite dev server config (vite.config.ts)
  • Set VITE_API_SERVER_URL to empty so frontend uses relative URLs (.env)
  • Remove flask-cors import and CORS config block (api/app.py)
  • Remove Flask-Cors and types-Flask-Cors dependencies (requirements.txt)
  • Update README to reflect proxy setup and correct CLIENT_ORIGIN_URL docs

In development, Vite now proxies /api requests to the Flask backend,
so both frontend and backend are accessed from the same origin. This
eliminates the need for CORS, which was only configured for development.

- Add /api proxy to Vite dev server config (vite.config.ts)
- Set VITE_API_SERVER_URL to empty so frontend uses relative URLs (.env)
- Remove flask-cors import and CORS config block (api/app.py)
- Remove Flask-Cors and types-Flask-Cors dependencies (requirements.txt)
- Update README to reflect proxy setup and correct CLIENT_ORIGIN_URL docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant