Support start/end query params in candles endpoint to prevent 404 for Hurst indicator

This commit is contained in:
DiTus
2026-03-18 22:27:30 +01:00
parent 1b6e307a79
commit b80597dc42

View File

@ -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 });
});
});