Internal URL - issue/question
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
Solution:Jump to solution
your frontend should be directly calling the public domain of the graphql server.
fun fact, this is exactly how railway's dashboard works.
what you're doing is security through obscurity, and that's not inherently secure, it's just going to make development harder on yourself....
5 Replies
Project ID:
4192a00e-89d7-4e81-be01-005041c8e063
4192a00e-89d7-4e81-be01-005041c8e063
you need to use the public domain when calling the backend via the frontend
please read this docs section - https://docs.railway.app/guides/private-networking#private-network-context
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...
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...
Solution
your frontend should be directly calling the public domain of the graphql server.
fun fact, this is exactly how railway's dashboard works.
what you're doing is security through obscurity, and that's not inherently secure, it's just going to make development harder on yourself.