CORS issues between two services
kevmok
PROOP

10 months ago

I am having trouble getting around CORS issues between my frontend and backend.

My frontend has a public railway domain that I am allowing in my backend

cors({
  origin: [env.AGORA_URL],
  methods: ["GET", "POST", "PUT", "DELETE"],
}),
...

In my frontend I am using my backend's internal url as an env var
VITE_MERCURY_URL=mercury.railway.internal:8080

And in my backend i'm doing something similar
AGORA_URL=https://agora-development.up.railway.app:8080

Is this the correct way to set it up? Or does the backend also need a public url?

I've tried changing the ports and also removing them but it does not seem to work

Solved

3 Replies

kevmok
PROOP

10 months ago

f5376e47-25bc-4744-8e51-94719df911c0


kevmok
PROOP

10 months ago

i am probs dumb, i have to make the backend also public and that fixes it


uxuz
MODERATOR

10 months ago

!s


Status changed to Solved uxuz 10 months ago


Loading...