Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Created October 24, 2014 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save j-mcnally/af776ce67000833bdcf0 to your computer and use it in GitHub Desktop.
Save j-mcnally/af776ce67000833bdcf0 to your computer and use it in GitHub Desktop.
defmodule Exq.RouterPlug do
import Plug.Conn
use Plug.Router
plug :match
plug :dispatch
get "/queues" do
IO.puts "YOLO"
conn
end
# get "/api/workers" do
# end
# match _ do
# # Serve UI
# end
end
defmodule ExqUi.Router do
use Phoenix.Router
pipeline :browser do
plug :super
plug Exq.RouterPlug
end
scope "/" do
# Use the default browser stack.
pipe_through :browser
get "/", ExqUi.PageController, :index, as: :pages
end
# Other scopes may use custom stacks.
# scope "/api" do
# pipe_through :api
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment