aboutsummaryrefslogtreecommitdiffstats
path: root/examples/elixir_hello_world/lib/elixir_hello_world/top_page_handler.ex
blob: 58e37b4d03f08ff72962d81a6fbc971de014b8ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
defmodule ElixirHelloWorld.TopPageHandler do
  def init(_transport, req, []) do
    {:ok, req, nil}
  end

  def handle(req, state) do
    {:ok, req} = :cowboy_req.reply(200, [], "Hello world!", req)
    {:ok, req, state}
  end

  def terminate(_reason, _req, _state), do: :ok
end