Iam doing a fetch to the IP of my VPS on Hostinguer, and the fetch isnt working, it seems that or the IP is wrong or i have bad setting on my VPS. this is the function on my front end
const setPreference = async () => {
try {
const result = await fetch('http://62.72.63.229:3001/createOrder', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ items: cartNoImg }),
});
console.log(result.status);
const orderData = await result.json();
console.log(orderData);
} catch (error) {
console.error('Error al obtener la preferencia:', error);
}
};
this is the error
POST http://62.72.63.229:3001/createOrder net::ERR_CONNECTION_TIMED_OUT VM19:1 Error al obtener la preferencia: TypeError: Failed to fetch
I expect the payment to go well basically and to succesfully fetch the url and to can actually pay