aboutsummaryrefslogtreecommitdiffstats
path: root/backend/__init__.py
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-11-22 08:48:15 +0200
committerGravatar ks129 <[email protected]>2020-11-22 08:48:15 +0200
commit2ac6e6494f077d50a20bf753bf780474609c98a2 (patch)
tree8cb80d9c6a9d37c7f857dfacbb2433a8d688be84 /backend/__init__.py
parentInstall Gunicorn (for production) and include uvicorn dependencies (diff)
Move CORS allowed origins to environment variable
Diffstat (limited to 'backend/__init__.py')
-rw-r--r--backend/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/__init__.py b/backend/__init__.py
index c3e59c8..6215961 100644
--- a/backend/__init__.py
+++ b/backend/__init__.py
@@ -1,3 +1,5 @@
+import os
+
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.cors import CORSMiddleware
@@ -9,7 +11,7 @@ middleware = [
Middleware(
CORSMiddleware,
allow_origins=[
- "https://forms.pythondiscord.com"
+ os.getenv("ALLOWED_URL", "https://forms.pythondiscord.com"),
],
allow_headers=[
"Authorization",