|
@@ -21,14 +21,23 @@ if config_env() == :prod do
|
|
|
For example: ecto://USER:PASS@HOST/DATABASE
|
|
For example: ecto://USER:PASS@HOST/DATABASE
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
|
|
+ port =
|
|
|
|
|
+ System.get_env("PORT") ||
|
|
|
|
|
+ raise "environment variable PORT is missing."
|
|
|
|
|
+
|
|
|
|
|
+ host =
|
|
|
|
|
+ System.get_env("HOST") ||
|
|
|
|
|
+ raise "environment variable HOST is missing."
|
|
|
|
|
+
|
|
|
config :toy, ToyWeb.Endpoint,
|
|
config :toy, ToyWeb.Endpoint,
|
|
|
|
|
+ url: [host: host, port: port],
|
|
|
http: [
|
|
http: [
|
|
|
# Enable IPv6 and bind on all interfaces.
|
|
# Enable IPv6 and bind on all interfaces.
|
|
|
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
|
|
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
|
|
|
# See the documentation on https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html
|
|
# See the documentation on https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html
|
|
|
# for details about using IPv6 vs IPv4 and loopback vs public addresses.
|
|
# for details about using IPv6 vs IPv4 and loopback vs public addresses.
|
|
|
ip: {0, 0, 0, 0, 0, 0, 0, 0},
|
|
ip: {0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
- port: String.to_integer(System.get_env("PORT") || "4000")
|
|
|
|
|
|
|
+ port: port
|
|
|
],
|
|
],
|
|
|
secret_key_base: secret_key_base
|
|
secret_key_base: secret_key_base
|
|
|
|
|
|