Update main.py
Browse files
main.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
from fastapi import FastAPI, Request
|
2 |
from fastapi.responses import JSONResponse
|
|
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
-
@app.
|
7 |
async def proxy(request: Request, path: str):
|
8 |
async with httpx.AsyncClient() as client:
|
9 |
# 使用相同的方法和路径参数发出请求
|
|
|
1 |
from fastapi import FastAPI, Request
|
2 |
from fastapi.responses import JSONResponse
|
3 |
+
import httpx
|
4 |
|
5 |
app = FastAPI()
|
6 |
|
7 |
+
@app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
|
8 |
async def proxy(request: Request, path: str):
|
9 |
async with httpx.AsyncClient() as client:
|
10 |
# 使用相同的方法和路径参数发出请求
|