File size: 428 Bytes
eb66dc5
 
 
 
 
 
 
 
 
 
 
 
 
 
8eb3eaf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

def create_app() -> FastAPI:
    app = FastAPI(title="File Sharing API")

    app.add_middleware(
        CORSMiddleware,
        allow_origins=["*"],  # Replace with your frontend URL in production
        allow_credentials=True,
        allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
        allow_headers=["*"],
    )

    return app