flag-quiz/config/runtime.exs

69 lines
2.2 KiB
Elixir

import Config
import FlagQuiz.ConfigHelpers, only: [get_env: 3, get_env: 2, get_env: 1]
port = get_env("PORT", 3759, :int)
host = get_env("HOST", "localhost")
host_port = get_env("HOST_PORT", 3759, :int)
url_scheme = if host_port == 443, do: "https", else: "http"
# Configures the endpoint
config :flag_quiz, FlagQuizWeb.Endpoint,
http: [port: port],
url: [
host: host,
port: host_port,
scheme: url_scheme
]
config :flag_quiz,
secret_msg: get_env("SECRET_MSG", "NOT_SET"),
q_amount: get_env("Q_AMOUNT", 10, :int),
q_time: get_env("Q_TIME", 10, :int)
case Config.config_env() do
# PROD ENV CONFIG
:prod ->
# Finally, we also include the path to a manifest
# containing the digested version of static files. This
# manifest is generated by the mix phoenix.digest task
# which you typically run after static files are built.
config :flag_quiz, FlagQuizWeb.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json",
secret_key_base: get_env("SECRET_KEY_BASE"),
live_view: [signing_salt: get_env("LV_SIGNING_SALT")],
# Required when using releases
server: true
# Do not print debug messages in production
config :logger, level: :error
# DEV ENV CONFIG
:dev ->
# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with brunch.io to recompile .js and .css sources.
config :flag_quiz, FlagQuizWeb.Endpoint,
secret_key_base: "gWdaZrx0+CB8iuwoC1LMNUD2Lp37PCqvv73Dgid6k+jESaQFWguzrf2hDAoIYE4U"
# Watch static and templates for browser reloading.
config :flag_quiz, FlagQuizWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/flag_quiz_web/(live|views)/.*(ex)$",
~r"lib/flag_quiz_web/templates/.*(eex)$"
]
]
# Set a higher stacktrace during development.
# Do not configure such in production as keeping
# and calculating stacktraces is usually expensive.
config :phoenix, :stacktrace_depth, 20
end