Skip to content

Commit

Permalink
Allow configuration of Ecto via URL
Browse files Browse the repository at this point in the history
  • Loading branch information
vloothuis committed Aug 15, 2023
1 parent 30f0530 commit a81c319
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions benchmarking/test/repo
Submodule repo added at d903b6
16 changes: 11 additions & 5 deletions core/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,17 @@ if config_env() == :prod do
config :core, :azure_storage_backend, sas_token: sas_token
end

config :core, Core.Repo,
username: System.get_env("DB_USER"),
password: System.get_env("DB_PASS"),
database: System.get_env("DB_NAME"),
hostname: System.get_env("DB_HOST")
database_url = System.get_env("DB_URL")

if database_url do
config :core, Core.Repo, url: database_url
else
config :core, Core.Repo,
username: System.get_env("DB_USER"),
password: System.get_env("DB_PASS"),
database: System.get_env("DB_NAME"),
hostname: System.get_env("DB_HOST")
end

config :core, GoogleSignIn,
redirect_uri: "https://#{host}/google-sign-in/auth",
Expand Down

0 comments on commit a81c319

Please sign in to comment.