Skip to content

Instantly share code, notes, and snippets.

@thebugcatcher
Last active March 7, 2017 20:57
Show Gist options
  • Save thebugcatcher/9a186fdf017fd9156db4597ee2016c82 to your computer and use it in GitHub Desktop.
Save thebugcatcher/9a186fdf017fd9156db4597ee2016c82 to your computer and use it in GitHub Desktop.
Rummage Introduction
defmodule RummageExample.Router do
use RummageExample.Web, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
end
pipeline :api do
plug :accepts, ["json"]
end
scope "/", RummageExample do
pipe_through :browser # Use the default browser stack
get "/", PageController, :index
resources "/products", ProductController # <-- Add this
resources "/categories", CategoryController # <-- Add this
end
# Other scopes may use custom stacks.
# scope "/api", RummageExample do
# pipe_through :api
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment