From 6198fd2b9302ddaaf02880efb0e4b226eecd4bc4 Mon Sep 17 00:00:00 2001 From: swve Date: Thu, 13 Apr 2023 00:24:37 +0200 Subject: [PATCH] feat: use env values instead of hardcoded --- app.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index d3a99f8b..fbbc876c 100644 --- a/app.py +++ b/app.py @@ -32,12 +32,10 @@ app = FastAPI( root_path="/" ) -origin_regex = re.compile(r"^http://[\w.-]+\.localhost:3000$") - app.add_middleware( CORSMiddleware, - allow_origin_regex=str(origin_regex.pattern), - allow_origins=["http://localhost:3000", "http://localhost:3001"], + allow_origin_regex=learnhouse_config.hosting_config.allowed_regexp, + allow_origins=learnhouse_config.hosting_config.allowed_origins, allow_methods=["*"], allow_credentials=True, allow_headers=["*"]