diff options
Diffstat (limited to 'lib/matrix_app_service/application.ex')
-rw-r--r-- | lib/matrix_app_service/application.ex | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/matrix_app_service/application.ex b/lib/matrix_app_service/application.ex index f3d5803..02d17f2 100644 --- a/lib/matrix_app_service/application.ex +++ b/lib/matrix_app_service/application.ex @@ -16,6 +16,11 @@ defmodule MatrixAppService.Application do # Start a worker by calling: MatrixAppService.Worker.start_link(arg) # {MatrixAppService.Worker, arg} ] + children = if Application.get_env(:matrix_app_service, :standalone, false) do + [MatrixAppServiceWeb.Endpoint | children] + else + children + end # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options @@ -26,7 +31,10 @@ defmodule MatrixAppService.Application do # Tell Phoenix to update the endpoint configuration # whenever the application is updated. def config_change(changed, _new, removed) do - MatrixAppServiceWeb.Endpoint.config_change(changed, removed) + if Application.get_env(:matrix_app_service, :standalone, false) do + MatrixAppServiceWeb.Endpoint.config_change(changed, removed) + end + :ok end end |