10 months ago
hi there, im a bit new to deploying on services like railway, and im trying to deploy a springboot backend on railway, and it does work, but the issue is with cross-origins. my frontend is a https site, whereas the public link we get with railway is an http link. is there any way to remedy this, or am i SOL?
28 Replies
10 months ago
The public link should not be an HTTP link. What button are you pressing to generate it?
10 months ago
If you own a domain you should use that for both the frontend and backend, with the backend having a subdomain. (For example backend.example.com)
10 months ago
If not then you can press the generate domain button and that will give you a usable HTTPS link
i do have a domain i own, and i'm currently hosting my frontend on netlify
10 months ago
Perfect
i bought the domain from namecheap, and i'm using their nameservers instead of namecheaps
10 months ago
Vercel's nameservers?
10 months ago
I would just use Cloudflare here
10 months ago
I didn't even know Netlify had nameservers
10 months ago
The domain? Yes.
ok so i was able to host my domain on cloudflare, just waiting on it to change nameservers and stuff
10 months ago
Hoorah
10 months ago
Yeah
10 months ago
Go into the backend's service settings and use backend.example.com
10 months ago
It'll instruct you
10 months ago
Then on your frontend you can call backend.x
10 months ago
It should be yes 😁
10 months ago
The name servers might take a few hours to update but over all it'll work!
10 months ago
Yerp! Should be basically instant with Cloudflare as well.
10 months ago
@oncle97 Did you get this working?