const API_BASE = "http://127.0.0.1:18080"; async function apiGet(path, params = {}) { const query = new URLSearchParams(params).toString(); const url = `${API_BASE}${path}?${query}`; const res = await fetch(url); if (!res.ok) { const data = await res.json(); throw new Error(data.detail || "APIエラー"); } return res.json(); }