Fix: Force IPv4 in Vite proxy to resolve Windows ::1 ECONNREFUSED error #260
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I encountered a network connection error on Windows where the frontend could not communicate with the backend, resulting in the error: Error: connect ECONNREFUSED ::1:8000.
This happens because localhost often resolves to IPv6 (::1) on Windows, but the Python backend listens on IPv4 (127.0.0.1). This PR fixes the vite.config.ts proxy settings to explicitly use the IPv4 address, ensuring consistent connectivity.
Changes Made
Config: Updated Frontend/vite.config.ts proxy target from http://localhost:8000 to http://127.0.0.1:8000.
📷 Screenshots or Visual Changes (if applicable)

Terminal: The error http proxy error: /api/trending-niches no longer appears in the logs.
before fix:
After Fix:

App: The frontend can now successfully fetch data from the backend API.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.