From b69903435e0278a6a91749d729f08ac01a8f623a Mon Sep 17 00:00:00 2001 From: Yurii Rashkovskii Date: Tue, 29 Jan 2013 10:18:52 -0800 Subject: Elixir hello world example --- .../lib/elixir_hello_world/top_page_handler.ex | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/elixir_hello_world/lib/elixir_hello_world/top_page_handler.ex (limited to 'examples/elixir_hello_world/lib/elixir_hello_world/top_page_handler.ex') diff --git a/examples/elixir_hello_world/lib/elixir_hello_world/top_page_handler.ex b/examples/elixir_hello_world/lib/elixir_hello_world/top_page_handler.ex new file mode 100644 index 0000000..58e37b4 --- /dev/null +++ b/examples/elixir_hello_world/lib/elixir_hello_world/top_page_handler.ex @@ -0,0 +1,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 -- cgit v1.2.3