8 months ago
I have successfully deployed both my frontend and my backend (with a postgres db successfully attached). However upon closer inspection and some testing I realize my frontend is not able to send requests to my backend. As the only functionality I can test at the moment (from my frontend) is login, I'm noticing that the http logs for the backend are not producing anything from a login (200 or error), while the frontend logs are responding appropriately.
I'm not sure if I missed something during the setup, but I attempted to resolve the ports and the BACKEND_URL is definitely correctly assigned on the frontend variables. I was able to hit it through postman and login successfully through there but I'm not sure if I have an issue from setting up the ports or something.
5 Replies
8 months ago
For the backend or API url you would need to use https://${{MercuryPyTy.RAILWAY_PUBLIC_DOMAIN}}
https://docs.railway.com/guides/variables#referencing-another-services-variable
https://docs.railway.com/reference/variables#railway-provided-variables
8 months ago
Hey Brody, thanks for the response. I tried that exact text for my backend_url variable and it still was not functional or able to communicate with the backend. Is there something else I could be missing?
8 months ago
I see BACKEND_URL
and NEXT_PUBLIC_API_URL
on your frontend service, make sure you use the value I gave you for both.
Additionally, "not functional" is not very helpful, please provide exact errors.
8 months ago
Yes, also using it for next_public_api_url was the key to getting it done. Thanks for your help.
Status changed to Solved brody • 8 months ago