Permalink
Browse files

consolidate into a single .ex file

  • Loading branch information...
1 parent ad0ef6c commit d33288a8d377925b330fbc01669436cff189cfde @clofresh committed Mar 21, 2012
Showing with 30 additions and 29 deletions.
  1. +30 −0 src/elixir_cowboy.ex
  2. +0 −17 src/elixir_cowboy_handler.ex
  3. +0 −12 src/elixir_cowboy_sup.ex
View
30 src/elixir_cowboy.ex
@@ -21,3 +21,33 @@ defmodule :elixir_cowboy do
end
end
+defmodule :elixir_cowboy_handler do
+ @behavior :cowboy_http_handler
+
+ def init({_, :http}, req, []) do
+ {:ok, req, :undefined}
+ end
+
+ def handle(req, state) do
+ {:ok, req2} = Erlang.cowboy_http_req.reply(200, [], "Hello world!", req)
+ {:ok, req2, state}
+ end
+
+ def terminate(_, _) do
+ :ok
+ end
+
+end
+
+defmodule :elixir_cowboy_sup do
+ @behavior :supervisor
+
+ def start_link() do
+ Erlang.supervisor.start_link({:local, :elixir_cowboy_sup}, :elixir_cowboy_sup, [])
+ end
+
+ def init([]) do
+ {:ok, {{:one_for_one, 10, 10}, []}}
+ end
+end
+
View
17 src/elixir_cowboy_handler.ex
@@ -1,17 +0,0 @@
-defmodule :elixir_cowboy_handler do
- @behavior :cowboy_http_handler
-
- def init({_, :http}, req, []) do
- {:ok, req, :undefined}
- end
-
- def handle(req, state) do
- {:ok, req2} = Erlang.cowboy_http_req.reply(200, [], "Hello world!", req)
- {:ok, req2, state}
- end
-
- def terminate(_, _) do
- :ok
- end
-
-end
View
12 src/elixir_cowboy_sup.ex
@@ -1,12 +0,0 @@
-defmodule :elixir_cowboy_sup do
- @behavior :supervisor
-
- def start_link() do
- Erlang.supervisor.start_link({:local, :elixir_cowboy_sup}, :elixir_cowboy_sup, [])
- end
-
- def init([]) do
- {:ok, {{:one_for_one, 10, 10}, []}}
- end
-end
-

0 comments on commit d33288a

Please sign in to comment.