CodeLens / dashboard /src /api.js
ArshVerma's picture
feat: finalize CodeLens. rebranding and production environment polish
adea8c3
Raw History Blame
384 Bytes
const BASE = import.meta.env.DEV ? "/api" : "";
export const fetchHealth = () => fetch(`${BASE}/health`).then(r => r.json());
export const fetchStats = () => fetch(`${BASE}/stats`).then(r => r.json());
export const fetchLeaderboard = (taskId, limit = 10) => fetch(`${BASE}/leaderboard?task_id=${taskId}&limit=${limit}`)
.then(r => r.json())
.then(data => data.entries || []);