feat(dashboard): add REST metrics endpoints for Next.js polling
- GET /metrics — live trading metrics - GET /metrics/paper — paper trading metrics - Enables polling from Next.js quant-lab page via Caddy proxy
This commit is contained in:
@@ -159,6 +159,19 @@ async def paper_websocket_endpoint(websocket: WebSocket):
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════
|
||||
|
||||
# ═══════════════════════════════════════════════════════════
|
||||
# REST metrics endpoints — polled by Next.js dashboard
|
||||
# ═══════════════════════════════════════════════════════════
|
||||
|
||||
@app.get("/metrics")
|
||||
async def get_metrics_rest():
|
||||
return JSONResponse(read_metrics())
|
||||
|
||||
@app.get("/metrics/paper")
|
||||
async def get_paper_metrics_rest():
|
||||
return JSONResponse(read_paper_metrics())
|
||||
|
||||
# Backtest endpoints
|
||||
# ═══════════════════════════════════════════════════════════
|
||||
|
||||
|
||||
Reference in New Issue
Block a user