I have a droplet with a react app and a flask server (uwsgi).
React app is accessible via
Flask Server is accessible via
My ReactApp is fetching data from my flask server via http://127.0.0.1:5000 as they are both hosted on the same server.
curl http://127.0.0.1:5000 from the server works perfectly.
However, when accessing the react app, it is showing 127.0.0.1:5000 ERR_CONNECTION_REFUSED.
No firewall (ufw) has been set-up.
Running both app via systemd via the following comment:
/usr/bin/serve -s /path/to/build -l 3000
/path/to/project/venv/bin/uwsgi --ini=uwsgi.ini --http :5000
I have tried replacing 127.0.0.1 with 0.0.0.0 and I have tried changing the port.
This textbox defaults to using Markdown to format your 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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!