2016-08-22 03:15:42 +00:00
|
|
|
defmodule Asciinema.Router do
|
|
|
|
use Asciinema.Web, :router
|
|
|
|
|
|
|
|
pipeline :browser do
|
|
|
|
plug :accepts, ["html"]
|
|
|
|
plug :fetch_session
|
|
|
|
plug :fetch_flash
|
|
|
|
plug :protect_from_forgery
|
|
|
|
plug :put_secure_browser_headers
|
2016-10-08 15:34:51 +00:00
|
|
|
plug Asciinema.Auth
|
2016-08-22 03:15:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
pipeline :api do
|
|
|
|
plug :accepts, ["json"]
|
|
|
|
end
|
|
|
|
|
|
|
|
scope "/", Asciinema do
|
|
|
|
pipe_through :browser # Use the default browser stack
|
|
|
|
|
2016-10-05 20:01:49 +00:00
|
|
|
get "/docs", DocController, :index
|
|
|
|
get "/docs/:topic", DocController, :show
|
2016-08-22 03:15:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Other scopes may use custom stacks.
|
|
|
|
# scope "/api", Asciinema do
|
|
|
|
# pipe_through :api
|
|
|
|
# end
|
|
|
|
end
|