Skip to content

Commit

Permalink
Use Elixir v1.5's streamlined child specs in docs (#3233)
Browse files Browse the repository at this point in the history
* Use Elixir v1.5's streamlined child specs in Endpoint docs

* Use Elixir v1.5's streamlined child specs in mix ecto.gen.repo docs
  • Loading branch information
michallepicki authored and Gazler committed Jan 7, 2019
1 parent dbcfe8e commit f168242
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion guides/endpoint.md
Expand Up @@ -10,7 +10,7 @@ defmodule Hello.Application do
#...

children = [
supervisor(HelloWeb.Endpoint, []),
HelloWeb.Endpoint
]

opts = [strategy: :one_for_one, name: Hello.Supervisor]
Expand Down
11 changes: 6 additions & 5 deletions guides/phoenix_mix_tasks.md
Expand Up @@ -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
]
. . .
```
Expand Down
4 changes: 3 additions & 1 deletion lib/phoenix/endpoint.ex
Expand Up @@ -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
Expand Down

0 comments on commit f168242

Please sign in to comment.