Skip to content

Fix: Configure CORS and enable credentialsFix: Configure CORS to allow frontend-backend communication#4

Merged
Alen983 merged 1 commit intoAlen983:mainfrom
vansh1925:fix/cors-configuration
Jan 28, 2026
Merged

Fix: Configure CORS and enable credentialsFix: Configure CORS to allow frontend-backend communication#4
Alen983 merged 1 commit intoAlen983:mainfrom
vansh1925:fix/cors-configuration

Conversation

@vansh1925
Copy link
Copy Markdown

Description

Fixes CORS errors when frontend requests backend API.

Changes

  • Added CORS configuration with specific allowed origins (FRONTEND_URL env var)
  • Enabled credentials support in both backend and frontend
  • Added .env.example files for environment setup documentation
  • Set allowed methods and headers for CORS

Testing

  • Backend runs on port 5001
  • Frontend runs on port 3000
  • No CORS errors in browser console
  • API requests succeed with proper credentials

Closes #1

- Add CORS options with allowed origin from FRONTEND_URL
- Enable credentials and allowed headers/methods
- Set axios client to send credentials
@Alen983 Alen983 merged commit bb2fa62 into Alen983:main Jan 28, 2026
@vansh1925
Copy link
Copy Markdown
Author

Thanks for the review and merge! Appreciate it.

@Alen983
Copy link
Copy Markdown
Owner

Alen983 commented Jan 29, 2026

@vansh1925 No worries!.Thank you for your contribution.
if you liked the repo, don't forget to star it.
Thank you.

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.

Fix CORS issue between frontend and backend

2 participants