From a031196abcb6232f14c2dde8ede73f3b0d3fa87a Mon Sep 17 00:00:00 2001 From: Arn Date: Thu, 19 Oct 2023 16:29:32 +0700 Subject: [PATCH] chore(app): allow cors --- main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.py b/main.py index a99a5c0..3c8177c 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,15 @@ from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware from routes.route import router app = FastAPI() +app.add_middleware( + CORSMiddleware, + allow_origins=['*'], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + app.include_router(router)