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