diff --git a/guides/endpoint.md b/guides/endpoint.md index b21de25999..c0dc01dfee 100644 --- a/guides/endpoint.md +++ b/guides/endpoint.md @@ -10,7 +10,7 @@ defmodule Hello.Application do #... children = [ - supervisor(HelloWeb.Endpoint, []), + HelloWeb.Endpoint ] opts = [strategy: :one_for_one, name: Hello.Supervisor] diff --git a/guides/phoenix_mix_tasks.md b/guides/phoenix_mix_tasks.md index c0171776bc..e5fed5f894 100644 --- a/guides/phoenix_mix_tasks.md +++ b/guides/phoenix_mix_tasks.md @@ -713,13 +713,14 @@ We certainly should follow the instructions and add our new repo to our supervis ```elixir . . . children = [ - # Start the endpoint when the application starts - supervisor(HelloWeb.Endpoint, []), # Start the Ecto repository - worker(Hello.Repo, []), + Hello.Repo, + # Start the endpoint when the application starts + HelloWeb.Endpoint, + # Starts a worker by calling: Hello.Worker.start_link(arg) + # {Hello.Worker, arg}, # Here you could define other workers and supervisors as children - # worker(Hello.Worker, [arg1, arg2, arg3]), - worker(OurCustom.Repo, []), + OurCustom.Repo ] . . . ``` diff --git a/lib/phoenix/endpoint.ex b/lib/phoenix/endpoint.ex index be35cc79a0..073dc874e0 100644 --- a/lib/phoenix/endpoint.ex +++ b/lib/phoenix/endpoint.ex @@ -38,7 +38,9 @@ defmodule Phoenix.Endpoint do to the supervision tree in generated applications. Endpoints can be added to the supervision tree as follows: - supervisor(YourApp.Endpoint, []) + children = [ + YourApp.Endpoint + ] ### Endpoint configuration