File size: 587 Bytes
b47bc59 94a9352 b47bc59 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from fastapi import FastAPI, HTTPException
from typing import List
import uvicorn
app = FastAPI()
stored_array = None # Global variable to hold the array
@app.post("/send-array")
async def send_array(array: List[List[List[List[int]]]]):
global stored_array
stored_array = array
return {"message": "Array stored successfully"}
@app.get("/get-array")
async def get_array():
if stored_array is None:
raise HTTPException(status_code=404, detail="No array found")
return stored_array
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=7860)
|