diff --git a/config/runtime.exs b/config/runtime.exs index 9e97417..a949407 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -2,6 +2,10 @@ import Config config :jenot, host: System.fetch_env!("HOST") +port = if config_env() == :test, do: 4001, else: 4000 + +config :jenot, port: port + config :jenot, secret_key_base: System.fetch_env!("SECRET_KEY_BASE") config :jenot, secure_cookie: System.fetch_env!("SECURE_COOKIE") == "true" diff --git a/lib/jenot/application.ex b/lib/jenot/application.ex index fae6fb7..2312fbf 100644 --- a/lib/jenot/application.ex +++ b/lib/jenot/application.ex @@ -9,7 +9,7 @@ defmodule Jenot.Application do children = [ Jenot.Repo, - {Bandit, plug: Jenot.Web, scheme: :http, port: 4000} + {Bandit, plug: Jenot.Web, scheme: :http, port: Application.fetch_env!(:jenot, :port)} ] opts = [strategy: :one_for_one, name: Jenot.Supervisor]