| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| def create_app(): | |
| # app = FastAPI(**swagger_config) | |
| app = FastAPI( | |
| title="BANDic+", description="API for BANDic+", version="1.0.0", docs_url="/" | |
| ) | |
| # CORs handling | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], # Allow all origins | |
| allow_credentials=True, | |
| allow_methods=["*"], # Allow all methods (GET, POST, etc.) | |
| allow_headers=["*"], # Allow all headers | |
| ) | |
| return app | |