summaryrefslogtreecommitdiff
path: root/lib/matrix_app_service/application.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/matrix_app_service/application.ex')
-rw-r--r--lib/matrix_app_service/application.ex32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/matrix_app_service/application.ex b/lib/matrix_app_service/application.ex
new file mode 100644
index 0000000..648cc70
--- /dev/null
+++ b/lib/matrix_app_service/application.ex
@@ -0,0 +1,32 @@
+defmodule MatrixAppService.Application do
+ # See https://hexdocs.pm/elixir/Application.html
+ # for more information on OTP Applications
+ @moduledoc false
+
+ use Application
+
+ def start(_type, _args) do
+ children = [
+ # Start the Telemetry supervisor
+ MatrixAppServiceWeb.Telemetry,
+ # Start the PubSub system
+ {Phoenix.PubSub, name: MatrixAppService.PubSub},
+ # Start the Endpoint (http/https)
+ MatrixAppServiceWeb.Endpoint
+ # Start a worker by calling: MatrixAppService.Worker.start_link(arg)
+ # {MatrixAppService.Worker, arg}
+ ]
+
+ # See https://hexdocs.pm/elixir/Supervisor.html
+ # for other strategies and supported options
+ opts = [strategy: :one_for_one, name: MatrixAppService.Supervisor]
+ Supervisor.start_link(children, opts)
+ end
+
+ # 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)
+ :ok
+ end
+end