Elixir Cowboy 2 options example
#https://gitlab.com/stressgrid/dummies/blob/master/elixir_dummy/lib/elixir_dummy/application.ex#L23 | |
defmodule Dummy.Application do | |
@moduledoc false | |
use Application | |
def start(_type, _args) do | |
dispatch = | |
:cowboy_router.compile([ | |
{:_, | |
[ | |
{"/", Dummy, %{}} | |
]} | |
]) | |
children = [ | |
%{ | |
id: :dummy, | |
start: | |
{:cowboy, :start_clear, | |
[ | |
:dummy, | |
%{max_connections: 999_999, socket_opts: [port: 5000]}, | |
%{max_keepalive: 1_000, env: %{dispatch: dispatch}} | |
]}, | |
restart: :permanent, | |
shutdown: :infinity, | |
type: :supervisor | |
} | |
] | |
opts = [strategy: :one_for_one, name: Dummy.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