Last active
March 7, 2017 20:57
-
-
Save thebugcatcher/9a186fdf017fd9156db4597ee2016c82 to your computer and use it in GitHub Desktop.
Rummage Introduction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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