6 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
6 months ago
The public link should not be an HTTP link. What button are you pressing to generate it?
6 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)
6 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
6 months ago
Perfect
i bought the domain from namecheap, and i'm using their nameservers instead of namecheaps
6 months ago
Vercel's nameservers?
6 months ago
I would just use Cloudflare here
6 months ago
I didn't even know Netlify had nameservers
6 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
6 months ago
Hoorah
6 months ago
Yeah
6 months ago
Go into the backend's service settings and use backend.example.com
6 months ago
It'll instruct you
6 months ago
Then on your frontend you can call backend.x
6 months ago
It should be yes 😁
6 months ago
The name servers might take a few hours to update but over all it'll work!
6 months ago
Yerp! Should be basically instant with Cloudflare as well.
6 months ago
@oncle97 Did you get this working?