2024-09-20 17:49:31 +01:00
|
|
|
from fastapi import FastAPI
|
2024-11-07 21:38:45 +00:00
|
|
|
from api.route import router
|
2025-01-11 16:35:25 +00:00
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
2024-09-20 17:49:31 +01:00
|
|
|
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
|
|
app.include_router(router)
|
2025-01-11 16:35:25 +00:00
|
|
|
|
|
|
|
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=["*"],
|
|
|
|
)
|