Skip to content

Instantly share code, notes, and snippets.

@renanvalentin
Last active October 22, 2016 15:59
Show Gist options
  • Save renanvalentin/b405499d16e983d6c0ab42b816f43cc6 to your computer and use it in GitHub Desktop.
Save renanvalentin/b405499d16e983d6c0ab42b816f43cc6 to your computer and use it in GitHub Desktop.
supervisor_config
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
# Define workers and child supervisors to be supervised
# worker(LearningElixir.Worker, [arg1, arg2, arg3]),
Plug.Adapters.Cowboy.child_spec(:http, LearningElixir.Router, [], [port: 4001])
]
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: LearningElixir.Supervisor]
Supervisor.start_link(children, opts)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment