Spaces:
BG5
/
Running

BG5 commited on
Commit
118fcbf
·
verified ·
1 Parent(s): 9e589c7

Update fun.py

Browse files
Files changed (1) hide show
  1. fun.py +2 -2
fun.py CHANGED
@@ -6,11 +6,11 @@ app = FastAPI()
6
  time.sleep(10)
7
  TARGET_BASE = "http://127.0.0.1:8001" # 替换为你的目标服务器
8
  resp = httpx.get(TARGET_BASE)
9
- print(f'RESP:{ resp.json()}')
10
  @app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
11
  async def proxy(request: Request, path: str):
12
  resp = httpx.get(TARGET_BASE)
13
- print(f'RESP:{resp.json()}')
14
  # if path == "":
15
  # # 拒绝根目录
16
  # return Response(content="Not Found", status_code=status.HTTP_404_NOT_FOUND)
 
6
  time.sleep(10)
7
  TARGET_BASE = "http://127.0.0.1:8001" # 替换为你的目标服务器
8
  resp = httpx.get(TARGET_BASE)
9
+ print(f'RESP:{ resp.json}')
10
  @app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
11
  async def proxy(request: Request, path: str):
12
  resp = httpx.get(TARGET_BASE)
13
+ print(f'RESP:{resp.json}')
14
  # if path == "":
15
  # # 拒绝根目录
16
  # return Response(content="Not Found", status_code=status.HTTP_404_NOT_FOUND)