defmodule FacesWeb.Router do use FacesWeb, :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 "/", FacesWeb do # Use the default browser stack pipe_through(:browser) resources("/", FaceController, only: [:index, :create]) end # Other scopes may use custom stacks. # scope "/api", FacesWeb do # pipe_through :api # end forward("/api", Absinthe.Plug, schema: FacesWeb.Schema) forward("/graphiql", Absinthe.Plug.GraphiQL, schema: FacesWeb.Schema) end