nicehero commited on
Commit
653ce63
·
1 Parent(s): 2526e18
Files changed (1) hide show
  1. main.py +5 -6
main.py CHANGED
@@ -14,15 +14,14 @@ async def get_vp_image(path: str):
14
 
15
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
16
 
17
- @app.post("/uploadVPMask/{path:path}")
18
- async def upload_vp_mask(path: str, request: Request):
19
- target_url = f"https://u7leyomozktm-5527.shanghai-01.dayunet.com/uploadVPMask/{path}"
20
- json_data = await request.json()
21
 
22
  async with httpx.AsyncClient() as client:
23
- response = await client.post(target_url, json=json_data)
24
 
25
- return response.text, response.status_code, response.headers.items()
26
 
27
  @app.post("/log-error")
28
  async def log_error(request: Request):
 
14
 
15
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
16
 
17
+ @app.get("/getVPImage/{path:path}")
18
+ async def get_vp_image(path: str):
19
+ target_url = f"https://u7leyomozktm-5527.shanghai-01.dayunet.com/getVPImage/{path}"
 
20
 
21
  async with httpx.AsyncClient() as client:
22
+ response = await client.get(target_url)
23
 
24
+ return Response(content=response.content, media_type="image/jpeg", status_code=response.status_code)
25
 
26
  @app.post("/log-error")
27
  async def log_error(request: Request):