Open iffikhan30 opened 3 months ago
bump
// Handle GET request
app.get("/apps/proxy", async (_req, res) => {
console.log("GET API");
try {
console.log("trying...");
res.status(200).send({ message: "Got it" });
} catch (error) {
res.status(500).send(error.message);
}
});
When i hit the URL without shopify.validateAuthenticatedSession() it work fine, but when I call on my component
const textProxy = (d) => {
return new Promise((resolve, reject) => {
fetch("SHOP-URL/apps/proxy", {
method: 'POST',
redirect: 'manual',
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'
},
body: JSON.stringify(d)
})
.then(response => {
console.log(response, 'response');
return response; // Assuming the response is in JSON format
})
.then(data => {
resolve(data);
})
.catch(error => {
reject(error);
console.log("test", error);
});
});
};
its show me 404 error, I am stuck please!
add to cart component
Inside the web proxyendpoint component in pages folder
When I click function 404 error can you please assists! I am stuck!