Skip to content

[GSSoC26] feat: Make CORS origins configurable via environment variables#433

Open
ashrion wants to merge 1 commit into
Nsanjayboruds:mainfrom
ashrion:feat/cors-config-env-vars
Open

[GSSoC26] feat: Make CORS origins configurable via environment variables#433
ashrion wants to merge 1 commit into
Nsanjayboruds:mainfrom
ashrion:feat/cors-config-env-vars

Conversation

@ashrion

@ashrion ashrion commented Jul 11, 2026

Copy link
Copy Markdown

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

- 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
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