diff options
author | 2020-11-22 08:48:15 +0200 | |
---|---|---|
committer | 2020-11-22 08:48:15 +0200 | |
commit | 2ac6e6494f077d50a20bf753bf780474609c98a2 (patch) | |
tree | 8cb80d9c6a9d37c7f857dfacbb2433a8d688be84 /backend/__init__.py | |
parent | Install 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__.py | 4 |
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", |