From 75e892107373b8090505b19e7920f68605570e55 Mon Sep 17 00:00:00 2001 From: Project_IO Date: Tue, 10 Sep 2024 21:20:03 +0900 Subject: [PATCH] feat: cors issue fixed --- app.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app.py b/app.py index 84055fa..2549fa7 100644 --- a/app.py +++ b/app.py @@ -1,9 +1,16 @@ from fastapi import FastAPI, Response from routes.auth import router as auth from routes.balance import router as balance +from fastapi.middleware.cors import CORSMiddleware app = FastAPI() +app.add_middleware( + CORSMiddleware, + allow_methods=["POST, GET, PATCH, DELETE"], + allow_headers=["*"] +) + @app.get("/") def index(resp: Response): resp.headers.setdefault("Content-Type", "text")