This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
graphql-lightning-talk/lib/faces_web/router.ex

31 lines
679 B
Elixir
Raw Normal View History

2018-04-08 09:20:53 +12:00
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)
2018-04-08 09:20:53 +12:00
end
pipeline :api do
plug(:accepts, ["json"])
2018-04-08 09:20:53 +12:00
end
scope "/", FacesWeb do
# Use the default browser stack
pipe_through(:browser)
2018-04-08 09:20:53 +12:00
resources("/", FaceController, only: [:index, :create])
2018-04-08 09:20:53 +12:00
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)
2018-04-08 09:20:53 +12:00
end