Вынес CORS в переменную окружения

This commit is contained in:
Андрей Дувакин 2025-08-11 17:14:09 +05:00
parent 9b58e09f37
commit 20d7939f14
2 changed files with 2 additions and 2 deletions

View File

@ -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'])

View File

@ -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'