router.ex 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. defmodule OpenpodWeb.Router do
  2. use OpenpodWeb, :router
  3. pipeline :browser do
  4. plug :accepts, ["html"]
  5. plug :fetch_session
  6. plug :fetch_flash
  7. plug :protect_from_forgery
  8. plug :put_secure_browser_headers
  9. end
  10. pipeline :api do
  11. plug :accepts, ["json"]
  12. end
  13. scope "/", OpenpodWeb do
  14. pipe_through :browser
  15. get "/", PageController, :index
  16. get "/howto", PageController, :howto
  17. end
  18. scope "/podcast", OpenpodWeb do
  19. pipe_through :browser
  20. get "/:identifier", FeedController, :by_identifier
  21. end
  22. # Other scopes may use custom stacks.
  23. # scope "/api", OpenpodWeb do
  24. # pipe_through :api
  25. # end
  26. # Enables LiveDashboard only for development
  27. #
  28. # If you want to use the LiveDashboard in production, you should put
  29. # it behind authentication and allow only admins to access it.
  30. # If your application does not have an admins-only section yet,
  31. # you can use Plug.BasicAuth to set up some basic authentication
  32. # as long as you are also using SSL (which you should anyway).
  33. if Mix.env() in [:dev, :test] do
  34. import Phoenix.LiveDashboard.Router
  35. scope "/" do
  36. pipe_through :browser
  37. live_dashboard "/dashboard", metrics: OpenpodWeb.Telemetry
  38. end
  39. end
  40. end