I am very new to programming and was suggested by a friend that I can use cloudfare as medium between my aws server and my app. For example, user input 'A' on my app, then my app will pass 'A' to the cloudfare and then cloudfare will pass it to my server. He say it will reduce troubles when I need to change my server hosting. But I cannot find relevant information on internet. I would like to know if this is a usual method to handle it?
When I try to pass data to cloudfare, I am using POST method.
fetch('https://reqres.in/api/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'user',
}),
})
.then((res) => {
return res.json();
})
.then((data) => console.log(data))
.catch((err) => console.log(err));
But I am quite confused by how can I read the data on cloudfare. By the way, I am using react-native for my app.