Skip to content

Instantly share code, notes, and snippets.

@darui00kara
Created May 31, 2015 05:43
Show Gist options
  • Save darui00kara/1963969c7a53e0527e11 to your computer and use it in GitHub Desktop.
Save darui00kara/1963969c7a53e0527e11 to your computer and use it in GitHub Desktop.
defmodule HelloPhoenix.Router do
use HelloPhoenix.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 "/", HelloPhoenix do
pipe_through :browser # Use the default browser stack
get "/", PageController, :index
get "/hello", HelloController, :index
end
# Other scopes may use custom stacks.
# scope "/api", HelloPhoenix do
# pipe_through :api
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment