From 83c640d361dd2c520777f32ee6476e7a00191693 Mon Sep 17 00:00:00 2001 From: ramseshk Date: Tue, 4 Aug 2026 03:21:13 +0000 Subject: [PATCH] Fix dashboard WebSocket and API URLs for /cv prefix routing The dashboard lives at ftdt.io/cv but WebSocket and API calls used root-relative paths (/ws, /api/backtests) which Caddy routed to the wrong backend. Fixed to /cv/ws and /cv/api/* so Caddy's handle_path properly strips the prefix. --- dashboard/static/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard/static/index.html b/dashboard/static/index.html index 8479e2b..393fb6f 100644 --- a/dashboard/static/index.html +++ b/dashboard/static/index.html @@ -222,7 +222,7 @@ function switchTab(tab) { // ═══════════════════════════════════════════════════════════ let ws; function connectWS() { - ws = new WebSocket((location.protocol==='https:'?'wss:':'ws:')+'//'+location.host+'/ws'); + ws = new WebSocket((location.protocol==='https:'?'wss:':'ws:')+'//'+location.host+'/cv/ws'); ws.onopen = function() { document.getElementById('connection-status').innerHTML = 'live'; document.getElementById('status-dot').className = 'status-dot live'; @@ -313,7 +313,7 @@ function renderLive() { // Backtests // ═══════════════════════════════════════════════════════════ function loadBacktests() { - fetch('/api/backtests').then(function(r){return r.json();}).then(function(data){ + fetch('/cv/api/backtests').then(function(r){return r.json();}).then(function(data){ backtests = data; var list = document.getElementById('bt-list'); var html = ''; @@ -334,7 +334,7 @@ function loadBacktests() { } function viewBacktest(name) { - fetch('/api/backtest/'+name).then(function(r){return r.json();}).then(function(bt){ + fetch('/cv/api/backtest/'+name).then(function(r){return r.json();}).then(function(bt){ selectedBacktest = bt; document.getElementById('bt-detail-card').style.display = 'block'; document.getElementById('bt-title').textContent = bt.strategy + ' — ' + bt.description;