From 603f9ac015701c6900a7b3a32260cc7a75fdc3c7 Mon Sep 17 00:00:00 2001 From: Arvind Shelke Date: Tue, 15 Jul 2025 04:45:51 +0530 Subject: [PATCH 1/3] Update main.py --- app/main.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/main.py b/app/main.py index 0342502..01e0778 100644 --- a/app/main.py +++ b/app/main.py @@ -12,15 +12,6 @@ version="1.0.0" ) -# Add CORS middleware -app.add_middleware( - CORSMiddleware, - allow_origins=["*"], # Configure this properly for production - allow_credentials=True, - allow_methods=["*"], - allow_headers=["*"], -) - # Include authentication routes app.include_router(auth_router) @@ -51,4 +42,4 @@ async def root(): "auth": "/auth", "protected": "/protected" } - } \ No newline at end of file + } From d268a7834ce5431b642f99649010e33544365d61 Mon Sep 17 00:00:00 2001 From: Arvind Shelke Date: Tue, 15 Jul 2025 04:50:43 +0530 Subject: [PATCH 2/3] Update main.py --- app/main.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 01e0778..f860c12 100644 --- a/app/main.py +++ b/app/main.py @@ -12,6 +12,21 @@ version="1.0.0" ) +# CORS setup +origins = [ + "http://localhost", + "http://localhost:3000", # React or frontend dev server + "https://your-frontend-domain.com" # Add your deployed frontend URL here +] + +app.add_middleware( + CORSMiddleware, + allow_origins=origins, # You can use ["*"] for all origins (not recommended for production) + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + # Include authentication routes app.include_router(auth_router) @@ -42,4 +57,4 @@ async def root(): "auth": "/auth", "protected": "/protected" } - } + } From 72d92dc749e4c99f886eecd61c047487d67744d1 Mon Sep 17 00:00:00 2001 From: Arvind Shelke Date: Tue, 15 Jul 2025 11:44:08 +0530 Subject: [PATCH 3/3] Update main.py --- app/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index f860c12..dcef595 100644 --- a/app/main.py +++ b/app/main.py @@ -14,9 +14,7 @@ # CORS setup origins = [ - "http://localhost", - "http://localhost:3000", # React or frontend dev server - "https://your-frontend-domain.com" # Add your deployed frontend URL here + "https://bubblesort.vercel.com" # Add your deployed frontend URL here ] app.add_middleware(