1
0
Fork 0
mirror of https://github.com/edgurgel/httparrot synced 2025-04-25 07:47:11 -04:00
httparrot/lib/httparrot/cowboy.ex
2014-07-22 20:33:22 +12:00

15 lines
358 B
Elixir

defmodule HTTParrot.Cowboy do
defmacro __using__(opts) do
methods = Keyword.get(opts, :methods, [])
quote bind_quoted: [methods: methods] do
def init(_transport, _req, _opts) do
{:upgrade, :protocol, :cowboy_rest}
end
def allowed_methods(req, state) do
{unquote(methods), req, state}
end
end
end
end