Current section
Files
Jump to
Current section
Files
lib/wemo/http_router.ex
defmodule WeMo.HTTPRouter do
def start_link do
port = Application.get_env(:ex_wemo, :http_port)
dispatch = :cowboy_router.compile([
{ :_,
[
{"/", WeMo.EventHandler, []},
]}
])
{:ok, _} = :cowboy.start_http(:interface_http,
10,
[{:ip, {0,0,0,0}}, {:port, port}],
[{:env, [{:dispatch, dispatch}]}]
)
end
end