Connect FE to BE using private networking
pfrex
PROOP

9 months ago

Hi, as described in the title I'm having issue connecting both services.
I'm using a React FE and a Fastify BE.
I've followed the instructions in here (https://docs.railway.com/guides/private-networking) and defined the env var as BACKENDURL=http://${{api.RAILWAYPRIVATE_DOMAIN}}:${{api.PORT}}
using the correct name instead of api.
In the BE I've defined the host to 0.0.0.0 and port as 8080.
Using public networking works without an issue but after adding console.logs to check requests being made in server and no request ir reaching the server when using private networking.
Am i missing a step in the configuration?

Solved

3 Replies

pfrex
PROOP

9 months ago

project ID: 0501ce2a-88fe-46ea-8f90-641f87678ffc


pfrex
PROOP

9 months ago

I apologize, I totally missed the explanation on Private Network Context

A web application that makes client-side requests cannot communicate to another service over the private network.
What I was trying to achieve is not possible.


9 months ago

!s


Status changed to Solved brody 9 months ago


Loading...