This commit is contained in:
Sam 2025-01-11 16:35:25 +00:00
parent c5feefe354
commit af992f2991
1 changed files with 15 additions and 0 deletions

View File

@ -1,6 +1,21 @@
from fastapi import FastAPI
from api.route import router
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.include_router(router)
origins = [
"https://baseddata.io",
"https://api.baseddata.io",
]
# Add the CORS middleware to the app
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)