Skip to content

Instantly share code, notes, and snippets.

@darui00kara
Created June 13, 2015 04:31
Show Gist options
  • Select an option

  • Save darui00kara/d056b13626862ec5ae8a to your computer and use it in GitHub Desktop.

Select an option

Save darui00kara/d056b13626862ec5ae8a to your computer and use it in GitHub Desktop.
defmodule PhoenixBbs.Router do
use PhoenixBbs.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 "/", PhoenixBbs do
pipe_through :browser # Use the default browser stack
get "/", PageController, :index
end
scope "/bbs", PhoenixBbs do
pipe_through :browser # Use the default browser stack
get "/", BbsController, :index
post "/comment_input", BbsController, :create
end
# Other scopes may use custom stacks.
# scope "/api", PhoenixBbs do
# pipe_through :api
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment