export async function handler(event) { console.log("cart called"); const API = process.env.API_BASE_URL; try { const res = await fetch(`${API}/cart`, { method: "POST", headers: { "Content-Type": "application/json", }, body: event.body, }); console.log(res); const data = await res.text(); return { statusCode: res.status, body: data, }; } catch (err) { return { statusCode: 500, body: JSON.stringify({ error: "Cart API failed" }), }; } }