#deploy postgresdb

24 messages · Page 1 of 1 (latest)

shut rain
#

hello new to all this. I am trying to use railway to deploy a postgres db but cannot see how to connect it with my front end. The url ive been using for the api call doesnt work

silver marlin
#

Do you want to connect to postgres from your frontend?

#

Or do you have a backend deployed somewhere?

shut rain
#

backend not deployed

#

I thought that this can be used to deploy a db

#

instead of heroku or something

silver marlin
#

You had a database on heroku previous amrite

shut rain
#

right

silver marlin
#

Cool so replace heroku's connection url with railway's

#

Click on your postgres instance -> connect tab -> copy url

shut rain
#

when I used that url i keep getting error messages

#

on my routes that i have made

#

do i have to run a deploy command on my db or something?

silver marlin
#

Postgres uses a different protocol

#

You can't connect to that using your browser

#

Mind dming me your heroku postgres url?

shut rain
#

its not up anymore. can rails not replace heroku?

#

ah i get what your saying in the heroku config replace the db url

#

In this scenario, whats the benefit of using rails to host my db instead of aws if its all through heroku

silver marlin
#

What's through heroku?

#

You can't connect to your database through just frontend

#

It's not secure + browsers don't support postgres's protocol.

#

You'll always need a backend in between