router.ex 1.1 KB

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