Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Elixir v1.5's streamlined child specs in docs #3233

Merged
merged 2 commits into from Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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