2 years ago
I am trying to use an internal URL inside of my reactapp to connect to a strapi instance..
I made a 'picture' showing the two scenarios and the output.. Unsure what I can do differently
5 Replies
2 years ago
you need to use the public domain when calling the backend via the frontend
2 years ago
please read this docs section -
Gotcha..
So is it not possible to fetch from the 'server' side using the internal url?
mind you I may be defining 'server' wrongly when I say this..
so by this i mean my express.js backend that is listening for a fetch from the frontend to reach out to graphql and get the data and then send it back over to the front..
if i can help it Im trying to be as 'secure' as possible so I can learn the proper way and figured that using an 'internal' url would be going down the right road…
2 years ago
your frontend should be directly calling the public domain of the graphql server.
what you're doing is security through obscurity, and that's not inherently secure, it's just going to make development harder on yourself.