mirror of
https://github.com/zoldar/jenot.git
synced 2026-01-03 14:32:54 +00:00
Differentiate Bandit port between test and other envs
This commit is contained in:
parent
e388cf5af5
commit
8cc9355286
2 changed files with 5 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue