From 20d7939f14fa3f0248ae407ff3accc12e7d4610c Mon Sep 17 00:00:00 2001 From: andrei Date: Mon, 11 Aug 2025 17:14:09 +0500 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=BD=D0=B5=D1=81=20CORS=20=D0=B2?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=83=D1=8E?= =?UTF-8?q?=20=D0=BE=D0=BA=D1=80=D1=83=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/main.py | 3 +-- api/app/settings.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/app/main.py b/api/app/main.py index 54cfe24..481c127 100644 --- a/api/app/main.py +++ b/api/app/main.py @@ -25,12 +25,11 @@ def start_app(): api_app.add_middleware( CORSMiddleware, - allow_origins=['https://api.visus.numerum.team', 'https://visus.numerum.team', 'http://localhost:5173'], + allow_origins=[settings.ALLOWED_ORIGIN], allow_credentials=True, allow_methods=['*'], allow_headers=['*'], ) - # api_app.add_middleware(MaintenanceModeMiddleware, enable_maintenance=False) api_app.include_router(appointment_files_router, prefix=f'{settings.APP_PREFIX}/appointment_files', tags=['appointment_files']) diff --git a/api/app/settings.py b/api/app/settings.py index 890d6d9..106b349 100644 --- a/api/app/settings.py +++ b/api/app/settings.py @@ -13,6 +13,7 @@ class Settings(BaseSettings): BACKUP_DB_URL: str PG_DUMP_PATH: str SCHEMA: str = 'public' + ALLOWED_ORIGIN: str = '*' class Config: env_file = '.env'