File size: 559 Bytes
de87e78
 
 
 
 
 
 
 
 
 
 
 
 
e0aaeda
de87e78
e0aaeda
 
de87e78
e0aaeda
de87e78
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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