from fastapi import FastAPI, UploadFile, File from fastapi.middleware.cors import CORSMiddleware app = FastAPI() @app.post("/uploadfile/") async def create_upload_file(file: UploadFile = File(...)): # Here you can save the file and do other operations as needed return {"filename": file.filename, "message": "Done"} app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) @app.get("/") def api_home(): return {'detail': 'Welcome to FastAPI Qdrant importer!'}