Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -10,13 +10,9 @@ app = FastAPI()
|
|
10 |
BASE_DIR = "/tmp/data"
|
11 |
|
12 |
@app.post("/save")
|
13 |
-
async def save(
|
14 |
body = await request.body()
|
15 |
print("RAW BODY RECEIVED →", body.decode())
|
16 |
-
os.makedirs(BASE_DIR, exist_ok=True)
|
17 |
-
filename = os.path.join(BASE_DIR, f"{image_data.originId}_{image_data.assetCode}.json")
|
18 |
-
with open(filename, "w") as f:
|
19 |
-
json.dump(image_data.dict(), f, indent=4)
|
20 |
return True
|
21 |
|
22 |
@app.get("/files")
|
|
|
10 |
BASE_DIR = "/tmp/data"
|
11 |
|
12 |
@app.post("/save")
|
13 |
+
async def save(request: Request):
|
14 |
body = await request.body()
|
15 |
print("RAW BODY RECEIVED →", body.decode())
|
|
|
|
|
|
|
|
|
16 |
return True
|
17 |
|
18 |
@app.get("/files")
|