diff --git a/api-server.js b/api-server.js index 73b23d1..23cee36 100644 --- a/api-server.js +++ b/api-server.js @@ -5,8 +5,8 @@ const PORT = 8000; const HOST = '20.20.20.20'; app.get('/api/v1/candles', (req, res) => { - const { interval } = req.query; - // Return mock candle data; include a sample for 148m interval + const { symbol, interval, limit, start, end } = req.query; + // Return mock candle data const mockCandles = [ { time: Math.floor(Date.now() / 1000) - 86400, @@ -36,6 +36,11 @@ app.get('/api/v1/candles', (req, res) => { volume: 1100 }); } + // If start/end are provided, they are ignored in this mock implementation, + // but the endpoint now accepts them to prevent 404 errors. + res.json({ candles: mockCandles }); +}); + } res.json({ candles: mockCandles }); }); });