use host and port variables

This commit is contained in:
2021-09-10 19:17:24 -04:00
committed by oliviasculley
parent e9ad552f2f
commit 89a5ff3c7b
5 changed files with 10 additions and 8 deletions

View File

@ -12,13 +12,14 @@ config :cannery,
# Configures the endpoint
config :cannery, CanneryWeb.Endpoint,
url: [host: "localhost"],
url: [host: System.get_env("HOST") || "localhost"],
http: [port: String.to_integer(System.get_env("PORT") || "80")],
secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I",
render_errors: [view: CanneryWeb.ErrorView, accepts: ~w(html json), layout: false],
pubsub_server: Cannery.PubSub,
live_view: [signing_salt: "zOLgd3lr"],
registration: System.get_env("REGISTRATION") || "invite"
config :cannery, :generators,
migration: true,
binary_id: true,

View File

@ -14,7 +14,6 @@ config :cannery, Cannery.Repo,
# watchers to your application. For example, we use it
# with webpack to recompile .js and .css sources.
config :cannery, CanneryWeb.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
check_origin: false,

View File

@ -10,8 +10,6 @@ import Config
# which you should run after static files are built and
# before starting your production server.
config :cannery, CanneryWeb.Endpoint,
url: [host: "localhost"],
http: [port: 4000],
cache_static_manifest: "priv/static/cache_manifest.json"
config :cannery, Cannery.Repo,

View File

@ -20,9 +20,12 @@ secret_key_base =
You can generate one by calling: mix phx.gen.secret
"""
host = System.get_env("HOST") || "localhost"
config :cannery, CanneryWeb.Endpoint,
url: [host: host],
http: [
port: String.to_integer(System.get_env("PORT") || "4000"),
port: String.to_integer(System.get_env("PORT") || "80"),
transport_options: [socket_opts: [:inet6]]
],
secret_key_base: secret_key_base,