Missing the linkage between frontend and backend of the deployed application
shiromys
HOBBYOP

5 months ago

We have deployed the backend, database, and frontend of the application successfully, but there is no communication being established from the frontend to the backend of the app. We identified that the issue is with the fallback occurring to localhost and not with the generated URL of the application's front and backends.

We have tried all possible methods, removed the localhost's URL from the FRONTEND_ORIGIN and URL sections of the code, and yet the issue persists. We also deleted the entire service and redeployed it again, thinking it might be an issue with the cache data, and yet no results.

We have hardcoded by adding the generated link (production) to establish the linkage. Variables are also set to the frontend and backend services via Railway's UI. We have been trying to establish a connection for many days now, and yet the issue remains unresolved.

Any insight is highly appreciated. Attached is the evidence that the fallback is happening only to the localhost and not to the railway-generated URL.

$10 Bounty

4 Replies

itsrems
EMPLOYEE

5 months ago

The fallback to localhost would likely be something on your end.


Status changed to Awaiting User Response Railway 5 months ago


itsrems
EMPLOYEE

5 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open itsrems 5 months ago


mertzamir
PRO

5 months ago

Couple things i can think of to check:
- making sure you're not using the private URL of your backend to establish connection from frontend app (your ss show <random_name>.railway.app as the url so i doubt this is the case)
- making sure your CORS policy in backend allows requests from your frontend (whatever public URL is assigned to your frontend needs to be added to allowed origins in your CORS middleware of backend)

maybe the 2nd one helps...


sim
FREE

5 months ago

Can you search code entirely for any thing with localhost?


sim
FREE

5 months ago

Update that to the service url
Last what @mertmazir said about CORS will help


Loading...