tenseleyflow/jubjubword / 77c1861

Browse files

split frontend urls from environment

Authored by espadonne
SHA
77c1861db93fa0cd7edd6b5debe824fc410a6f14
Parents
864fe59
Tree
43b4519

1 changed file

StatusFile+-
M backend/jubjub/settings.py 4 2
backend/jubjub/settings.pymodified
@@ -136,9 +136,11 @@ CORS_ALLOWED_ORIGINS = [
136
     "http://localhost:3000",  # Next.js default port
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
 if os.environ.get('FRONTEND_URL'):
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
 REST_FRAMEWORK = {
145
 REST_FRAMEWORK = {
144
     'DEFAULT_PERMISSION_CLASSES': [
146
     'DEFAULT_PERMISSION_CLASSES': [