How to connect a Droplet hosting a site to an app hosting an API

I have a DO app with a react application. This application connects to my DO Droplet to retrieve some search results.

When I attempt to connect from my development environment the Droplet, it returns data and the locally deployed react app displays the data.

However, when I deploy the react app onto the Droplet I receive the error: Unhandled Rejection (TypeError): Not allowed to request resource

This originates in the applications request to the API hosted on the droplet. I have attempted both the public IP for the droplet as well as the private IP. The same issue occurrs once the application is deployed on the DO app.

What areas can I look at where there might be an issue?

const fetchReferences = async () => {

fetch(‘’, {. //this is the line that errors. method: ‘POST’, body: JSON.stringify({ url: searchState.searchCriteria


@njw, I’m allowing everything.

app = Flask(name) CORS(app, resources={r"/": {“origins”: ""}}) api = Api(app) parser = reqparse.RequestParser()

Hey there! Are you using any CORS configuration on the API that could be blocking that request?

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


As far as I can see, you have the CORS configured correctly, however if your frontend app is loading via HTTPS you would need to set up your backend service via HTTPS as well.

You could do that by using Nginx as a reverse proxy and then installing a free Let’s Encrypt SSL certificate as per the instructions here:

Regards, Bobby