Skip to content

Instantly share code, notes, and snippets.

@darui00kara
Created June 7, 2015 05:59
Show Gist options
  • Save darui00kara/95d39578436e1077628b to your computer and use it in GitHub Desktop.
Save darui00kara/95d39578436e1077628b to your computer and use it in GitHub Desktop.
defmodule PhoenixChannels.Router do
use PhoenixChannels.Web, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
end
pipeline :api do
plug :accepts, ["json"]
end
scope "/", PhoenixChannels do
pipe_through :browser # Use the default browser stack
get "/", PageController, :index
end
socket "/ws", PhoenixChannels do
channel "rooms:*", RoomChannel
end
# Other scopes may use custom stacks.
# scope "/api", PhoenixChannels do
# pipe_through :api
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment