From 7b267e60e22615b8c903e8245c260ac687dc90d6 Mon Sep 17 00:00:00 2001 From: Madiwka Date: Sat, 11 Nov 2023 16:40:01 +0600 Subject: [PATCH] CORS Fix --- app/core/config.py | 2 +- app/main.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index beff9c0..46d5128 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -3,7 +3,7 @@ class Settings: PROJECT_VERSION: str = "1.0.0" POSTGRES_USER: str = "VMSBase" POSTGRES_PASSWORD = "VMSBasePass" - POSTGRES_SERVER: str = "localhost" + POSTGRES_SERVER: str = "db" POSTGRES_PORT: str = "5432" POSTGRES_DB: str = "VMSData" DATABASE_URL = f"postgresql://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{POSTGRES_SERVER}:{POSTGRES_PORT}/{POSTGRES_DB}" diff --git a/app/main.py b/app/main.py index 8ea3016..cc56a50 100644 --- a/app/main.py +++ b/app/main.py @@ -20,9 +20,9 @@ def startup(): # start the project, and create the tables include_routes(app) return app - +origins = ["*"] app = startup() -app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"],) +app.add_middleware(CORSMiddleware, allow_origins=origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"]) # Testing stuff @app.get("/")