Current section

Files

Jump to
nerves_bootstrap templates new lib app_name application.ex
Raw

templates/new/lib/app_name/application.ex

defmodule <%= app_module %>.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
@target Mix.Project.config()[:target]
use Application
def start(_type, _args) do
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: <%= app_module %>.Supervisor]
Supervisor.start_link(children(@target), opts)
end
# List all child processes to be supervised
def children("host") do
[
# Starts a worker by calling: <%= app_module %>.Worker.start_link(arg)
# {<%= app_module %>.Worker, arg},
]
end
def children(_target) do
[
# Starts a worker by calling: <%= app_module %>.Worker.start_link(arg)
# {<%= app_module %>.Worker, arg},
]
end
end