Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions apps/boruta_gateway/lib/boruta_gateway/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule BorutaGateway.Application do
alias BorutaGateway.Upstreams
alias BorutaGateway.Upstreams.ClientSupervisor

@impl Application
def start(_type, _args) do
children = [
BorutaGateway.Repo,
Expand All @@ -27,11 +28,11 @@ defmodule BorutaGateway.Application do
[
%{
start:
{BorutaGateway.Server, :start_link,
{BorutaGateway.Gateway.Server, :start,
[
[
port: Application.fetch_env!(:boruta_gateway, :port),
router: BorutaGateway.Router
num_acceptors: 10
]
]},
id: :server
Expand All @@ -43,28 +44,6 @@ defmodule BorutaGateway.Application do
children
end

children =
case Application.get_env(:boruta_gateway, :sidecar_server) do
true ->
[
%{
start:
{BorutaGateway.Server, :start_link,
[
[
port: Application.fetch_env!(:boruta_gateway, :sidecar_port),
router: BorutaGateway.SidecarRouter
]
]},
id: :sidecar_server
}
| children
]

_ ->
children
end

setup_database()
Supervisor.start_link(children, strategy: :one_for_one, name: BorutaGateway.Supervisor)
end
Expand Down
Loading
Loading