Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Created October 24, 2014 21:09
Show Gist options
  • Save j-mcnally/044a231a6988f4084e83 to your computer and use it in GitHub Desktop.
Save j-mcnally/044a231a6988f4084e83 to your computer and use it in GitHub Desktop.
defmodule Exq.RouterPlug do
require Logger
import Plug.Conn
use Plug.Router
plug :match
plug :dispatch
def init(options) do
# initialize options
setup_routes(options[:mount] || "")
options
end
def setup_routes(namespace \\ "") do
get "#{namespace}/queues" do
Logger.debug "YOLO"
conn |> halt
end
end
match _ do
conn
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment