Skip to content

Instantly share code, notes, and snippets.

@tobyhede
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobyhede/03250c00fca6d7434e45 to your computer and use it in GitHub Desktop.
Save tobyhede/03250c00fca6d7434e45 to your computer and use it in GitHub Desktop.
defmodule Route do

  import Weber.Route
  require Weber.Route

  route on("GET", "/new", :WeberTest.Main, :blah)
    |>  on("GET", "/", :WeberTest.Main, :index)

end


defmodule WeberTest.Main do

  def blah([], _conn) do
    {:render, [response: "ok"], []}
  end

  def index(_, _conn) do
    {:render, [count: 10], []}
  end

end

2014-05-01 10:13:05 =ERROR REPORT==== Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.291.0> exit with reason: {[{reason,undef},{mfa,{'Elixir.Handler.WeberReqHandler',handle,2}},{stacktrace,[{'WeberTest.Main','info',[functions],[]},{'Elixir.Handler.WeberReqHandler',handle,2,[{file,"lib/weber/handler/weber_req_handler.ex"},{line,94}]},{cowboy_handler,handler_handle,4,[{file,"src/cowboy_handler.erl"},{line,115}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]},{req,[{socket,#Port<0.6136>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.291.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},61621}},{host,<<"localhost">>},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment