Add public pricing proxy endpoint (forwards to Vela Platform P&L)
This commit is contained in:
@@ -165,6 +165,21 @@ class AnalyzeBody(BaseModel):
|
|||||||
submission_ids: list[int] = []
|
submission_ids: list[int] = []
|
||||||
all: bool = False
|
all: bool = False
|
||||||
|
|
||||||
|
|
||||||
|
# ---- Public Pricing Proxy (fetches from P&L Platform on CT 125) ----
|
||||||
|
|
||||||
|
@app.get("/api/public/pricing")
|
||||||
|
async def proxy_public_pricing():
|
||||||
|
"""Proxy: fetch live pricing from Vela Platform P&L manager."""
|
||||||
|
import urllib.request, json
|
||||||
|
try:
|
||||||
|
req = urllib.request.Request("http://192.168.1.125/api/public/pricing")
|
||||||
|
with urllib.request.urlopen(req, timeout=5) as resp:
|
||||||
|
return json.loads(resp.read().decode())
|
||||||
|
except Exception as e:
|
||||||
|
raise HTTPException(502, f"P&L backend unavailable: {e}")
|
||||||
|
|
||||||
|
|
||||||
# ---- Auth ----
|
# ---- Auth ----
|
||||||
|
|
||||||
@app.post("/admin/login")
|
@app.post("/admin/login")
|
||||||
|
|||||||
Reference in New Issue
Block a user