Skip to content

Instantly share code, notes, and snippets.

@adanselm
Created June 17, 2015 09:20
Show Gist options
  • Save adanselm/8bfb4c78ed9d6c350329 to your computer and use it in GitHub Desktop.
Save adanselm/8bfb4c78ed9d6c350329 to your computer and use it in GitHub Desktop.
A typical Phoenix router
defmodule SbSso.Router do
use Phoenix.Router
pipeline :api do
plug :accepts, ~w(json)
end
# /API section
scope "/api", alias: SbSso.Api, as: :api do
pipe_through :api
resources "/users", UserController, except: [:new, :edit] do
resources "/subs", SubscriptionController, only: [:index, :show, :create]
end
resources "/products", ProductController, except: [:new, :edit]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment