split frontend urls from environment
- SHA
77c1861db93fa0cd7edd6b5debe824fc410a6f14- Parents
-
864fe59 - Tree
43b4519
77c1861
77c1861db93fa0cd7edd6b5debe824fc410a6f14864fe59
43b4519| Status | File | + | - |
|---|---|---|---|
| M |
backend/jubjub/settings.py
|
4 | 2 |
backend/jubjub/settings.pymodified@@ -136,9 +136,11 @@ CORS_ALLOWED_ORIGINS = [ | ||
| 136 | 136 | "http://localhost:3000", # Next.js default port |
| 137 | 137 | ] |
| 138 | 138 | |
| 139 | -# Add production frontend URL if provided | |
| 139 | +# Add production frontend URL(s) if provided - supports comma-separated values | |
| 140 | 140 | if os.environ.get('FRONTEND_URL'): |
| 141 | - CORS_ALLOWED_ORIGINS.append(os.environ.get('FRONTEND_URL')) | |
| 141 | + frontend_urls = os.environ.get('FRONTEND_URL').split(',') | |
| 142 | + for url in frontend_urls: | |
| 143 | + CORS_ALLOWED_ORIGINS.append(url.strip()) | |
| 142 | 144 | |
| 143 | 145 | REST_FRAMEWORK = { |
| 144 | 146 | 'DEFAULT_PERMISSION_CLASSES': [ |