export async function roastCode(code, language) { const res = await fetch('/api/roast', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ code, language }), }); if (!res.ok) throw new Error((await res.json()).error); return res.json(); }