defmodule Cvapp.Router do use Cvapp.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 :browser_auth do plug Guardian.Plug.VerifySession plug Guardian.Plug.LoadResource end pipeline :api do plug :accepts, ["json"] end scope "/", Cvapp do pipe_through [:browser, :browser_auth] # Use the default browser stack get "/", PageController, :index resources "/users", UserController, only: [:index, :new, :show, :create] resources "/sessions", SessionController, only: [:new, :create, :delete] end # Other scopes may use custom stacks. # scope "/api", Cvapp do # pipe_through :api # end end