Spaces:
Runtime error
Runtime error
from fastapi import FastAPI, UploadFile, File | |
from fastapi.middleware.cors import CORSMiddleware | |
app = FastAPI() | |
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=["*"], | |
) | |
def api_home(): | |
return {'detail': 'Welcome to FastAPI Qdrant importer!'} |