Spaces:
Running on Zero
Running on Zero
Buffy commited on
Commit ·
bb11950
1
Parent(s): abb3d7d
Proxy: type the Request param for FastAPI DI
Browse files- node_probe.py +2 -1
node_probe.py
CHANGED
|
@@ -15,6 +15,7 @@ import time
|
|
| 15 |
import urllib.request
|
| 16 |
|
| 17 |
import httpx
|
|
|
|
| 18 |
from fastapi.responses import JSONResponse, Response
|
| 19 |
|
| 20 |
import node_runtime
|
|
@@ -81,7 +82,7 @@ def register_routes(fa_app):
|
|
| 81 |
|
| 82 |
@fa_app.get("/respite/v2/node/proxy/{path:path}")
|
| 83 |
@fa_app.post("/respite/v2/node/proxy/{path:path}")
|
| 84 |
-
async def _proxy(request, path: str):
|
| 85 |
"""Forward method, query string, body and headers to the Node backend
|
| 86 |
on 127.0.0.1:3210. Streaming both ways (SSE included)."""
|
| 87 |
if not node_runtime.node_ready():
|
|
|
|
| 15 |
import urllib.request
|
| 16 |
|
| 17 |
import httpx
|
| 18 |
+
from fastapi import Request
|
| 19 |
from fastapi.responses import JSONResponse, Response
|
| 20 |
|
| 21 |
import node_runtime
|
|
|
|
| 82 |
|
| 83 |
@fa_app.get("/respite/v2/node/proxy/{path:path}")
|
| 84 |
@fa_app.post("/respite/v2/node/proxy/{path:path}")
|
| 85 |
+
async def _proxy(request: Request, path: str):
|
| 86 |
"""Forward method, query string, body and headers to the Node backend
|
| 87 |
on 127.0.0.1:3210. Streaming both ways (SSE included)."""
|
| 88 |
if not node_runtime.node_ready():
|