Skip to content

Instantly share code, notes, and snippets.

@shufo
Created November 14, 2018 15:22
Show Gist options
  • Save shufo/073457fe8871672830d99adf4d626fa5 to your computer and use it in GitHub Desktop.
Save shufo/073457fe8871672830d99adf4d626fa5 to your computer and use it in GitHub Desktop.
defmodule LogViewer do
use Application
require Logger
def start(_type, _args) do
import Supervisor.Spec, warn: false
children =
[
worker(LogViewer.Server, [[port: Application.get_env(:log_viewer, :port, 5900)]]),
supervisor(Registry, [[keys: :duplicate, name: :client_registry]])
]
opts = [strategy: :one_for_one, name: LogViewer.Supervisor]
Supervisor.start_link(children, opts)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment