Railway postgres connection to vercel front-end

0xmemeterminal
TRIAL

7 months ago

Hi guys ! Sorry for the noob question…

I have set up a postgresql on railway and I would like to connect it to my vercel front-end.

I have a question for the environment variable :

datasource db {
provider = "postgresql"
url = env("DATABASEURL") directUrl = env("DIRECTURL")
}

For the variables, should I use the DATABASEPUBLICURL proxied env from Railway or I need to create a custom domain in the Settings -> Networking -> Public Networking

Thank you for your help πŸ™‚

0 Replies

0xmemeterminal
TRIAL

7 months ago

N/A


7 months ago

Since your frontend is on vercel and not on railway, u will need to use the public URL


7 months ago

That will make your project get some egress fees though, since they aren't on the same private network.


0xmemeterminal
TRIAL

7 months ago

thank you for your reply, I'll try it πŸ™‚


7 months ago

may I ask why not run your frontend on railway too?


Railway postgres connection to vercel front-end - Railway Help Station