aboutsummaryrefslogtreecommitdiffstats
path: root/examples/elixir_hello_world/lib/elixir_hello_world.ex
blob: 2da484bb91ef3611a19a98c7f2cdc2308fcd499c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
defmodule ElixirHelloWorld do
  use Application.Behaviour

  def start(_type, _args) do
    dispatch = :cowboy_router.compile([
                 {:_, [{"/", ElixirHelloWorld.TopPageHandler, []}]}
               ])
    {:ok, _} = :cowboy.start_http(:http, 100,
                                  [port: 8080],
                                  [env: [dispatch: dispatch]])
    ElixirHelloWorld.Supervisor.start_link
  end
end