router.ex 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. get "/chi", PageController, :chi
  18. end
  19. scope "/podcast", OpenpodWeb do
  20. pipe_through :browser
  21. get "/:identifier", FeedController, :by_identifier
  22. end
  23. # Other scopes may use custom stacks.
  24. # scope "/api", OpenpodWeb do
  25. # pipe_through :api
  26. # end
  27. # Enables LiveDashboard only for development
  28. #
  29. # If you want to use the LiveDashboard in production, you should put
  30. # it behind authentication and allow only admins to access it.
  31. # If your application does not have an admins-only section yet,
  32. # you can use Plug.BasicAuth to set up some basic authentication
  33. # as long as you are also using SSL (which you should anyway).
  34. if Mix.env() in [:dev, :test] do
  35. import Phoenix.LiveDashboard.Router
  36. scope "/" do
  37. pipe_through :browser
  38. live_dashboard "/dashboard", metrics: OpenpodWeb.Telemetry
  39. end
  40. end
  41. end