R
Railway12mo ago
cern7

Internal routing issue

ProjectID: 0609d9e9-c979-4a60-abc4-c954d2f050e5 I have an issue with internal routing of my services. I have UI service (available through public domain as well as communicating internally with backend) and backend service (available just on internal subnet) This is the private domain of backEnd : backend.railway.internal This is the public domain of UI: notifyme.up.railway.app This is the private domain of UI: ui.railway.internal (in case you need it to understand the issue) In UI service I have a variable VITE_BACKEND_API_URL:backend This (see ss1) is how I retrieve the variable in js. The issue is I get 405 Method not Allowed (see ss2) and this Path: https://notifyme.up.railway.app/backend.railway.internal/api/auth/register I expect it to be: backend.railway.internal/api/auth/register This (see ss3) is the log in UI service (no related logs in backend) Repo in case you need it :https://github.com/cern7/notifyMe/tree/main/UI/notife-me-app-ui
GitHub
notifyMe/UI/notife-me-app-ui at main · cern7/notifyMe
Contribute to cern7/notifyMe development by creating an account on GitHub.
No description
No description
No description
7 Replies
Percy
Percy12mo ago
Project ID: 0609d9e9-c979-4a60-abc4-c954d2f050e5
cern7
cern712mo ago
How can I make sure that UI service calling just backend url, without any public domain of ui service ?
Brody
Brody12mo ago
make sure VITE_BACKEND_API_URL is an actual url with https://<public backend domain>
cern7
cern712mo ago
why public? https://<public backend domain> and not private, I don't want to expose backend directly, I want the user communicate through ui. or I missing something ?
Brody
Brody12mo ago
it's a client side rendered website, aka the clients browser will be making the api calls, therefore you need to use the public url of your backend. wouldn't be much of a private network if anyone's browser could make api calls to it
cern7
cern711mo ago
is there a way to make BackEnd address private UI address public, UI communicating to back end private ?
Brody
Brody11mo ago
please read the message you just simply cant use a private domain if a clients browser will be making the api call, thats just how it works, no two ways about that. you want to implement some form of auth instead
Want results from more Discord servers?
Add your server