[GSSoC26] feat: Make CORS origins configurable via environment variables#433
Open
ashrion wants to merge 1 commit into
Open
[GSSoC26] feat: Make CORS origins configurable via environment variables#433ashrion wants to merge 1 commit into
ashrion wants to merge 1 commit into
Conversation
- Create backend/config/cors.js with centralized CORS configuration - Support CORS_ORIGINS comma-separated env var for allowed origins - Support CORS_ORIGIN_ADMIN and CORS_ORIGIN_FRONTEND individual env vars - Update app.js and notificationService.js to use new config - Add CORS_ORIGINS documentation to backend/.env.example GSSoC26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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\nThis PR makes CORS origins configurable via environment variables instead of hardcoding them in the source code.\n\n## Changes\n- Created �ackend/config/cors.js - new CORS configuration module\n- Updated �ackend/app.js to use configurable CORS origins\n- Updated �ackend/services/notificationService.js to use configurable CORS for Socket.IO\n- Added CORS_ORIGINS, CORS_ORIGIN_FRONTEND, CORS_ORIGIN_ADMIN to �ackend/.env.example\n\n## Motivation\n- Currently CORS origins are hardcoded in both �pp.js and
otificationService.js\n- This makes deployment to different environments difficult\n- Environment variables allow flexible configuration per deployment\n\n## Testing\n- Verify existing hardcoded origins still work as defaults\n- Set custom CORS_ORIGINS env var and verify it's used\n\nCloses #432\n\nGSSoC26 contribution