I am hosting an Ubuntu VM running apache2 on GCP cloud compute. I have an FQDN/domain name I can hit from my browser to give me data I need for my react app.
My react app is hosted on GCP app engine. I did not want to pay for/deal with SSL certs, so I'm trying to reach both endpoints with just http. When I locally host my react app, it connects via https and is unable to retrieve data from an "insecure" source via http.
When I try to load the React app in gcloud app engine and connect via http, it refuses to load the request to my API because it is from an outside resource. I've attempted to set up a proxy to the api with http-middleware. But I have had issues with that as well.
The app is a simple checkers game, and the api is made to return a move for the enemy player. Here is the line where the api is called:
fetch('http://ai.checkers-bot.com/bot/?board=' + api_load + '&player=Bb')
.then(res => console.log(res))
.catch(console.log);
I've researched the topic as much as I can, but every solution seems to be a situation where you are running a backend node service, and proxy through that to a locally ran api. I need to hit my own api, on a different domain via http.