HI
When I upgraded Shopify and Remix package, I am getting cors error in Checkout UI extension. This is the code of Checkout UI.
useEffect(()=>{> async function getData() {> try {> const token = await sessionToken.get();> const response = await fetch(
${app_url}/api/checkout/checkout, {> method: “POST”,> headers: {> ‘Content-Type’: ‘application/json’,> Authorization:Bearer ${token},> “Access-Control-Allow-Origin”: “*”,> },> body: JSON.stringify({> shop: shop.myshopifyDomain,> checkout_token :${checkoutToken}> }),> });> > const data = await response.json();> console.log(“Fetched data:”, data); // Handle the data as needed> } catch (error) {> console.error(“Error fetching data:”, error);> }> }> getData();> }, );
Thanks for help
