How to connect phoenix to a database as a service

How do i connect phoenix to a database as a service ?

Do you mean connecting to an externally hosted database?

config :my_app, MyApp.Repo,
  url: "postgres://username:password@host:port/database"

Just replace the config values to fit your connection.

2 Likes

How do i connect phoenix to a database as a service ?

Like any database: use the environment-specific files in config/*.exs
that are generated on a standard mix phx.new.

1 Like