lakshmisravya123
Deploy Code Roast Battle app
1ee4c18
raw
history blame contribute delete
298 Bytes
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();
}