|
from fastapi import FastAPI, HTTPException |
|
from typing import List |
|
import uvicorn |
|
|
|
app = FastAPI() |
|
stored_array = None |
|
|
|
@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 {"array": stored_array} |
|
|
|
if __name__ == "__main__": |
|
uvicorn.run(app, host="0.0.0.0", port=7860) |
|
|