mirror of
https://codeberg.org/JasterV/intisync.ex.git
synced 2026-04-26 18:10:07 +00:00
49 lines
1.3 KiB
Elixir
49 lines
1.3 KiB
Elixir
defmodule IntisyncWeb.Router do
|
|
use IntisyncWeb, :router
|
|
|
|
pipeline :browser do
|
|
plug :accepts, ["html"]
|
|
plug :fetch_session
|
|
plug :fetch_live_flash
|
|
plug :put_root_layout, html: {IntisyncWeb.Layouts, :root}
|
|
plug :protect_from_forgery
|
|
plug :put_secure_browser_headers
|
|
end
|
|
|
|
pipeline :hub do
|
|
plug :accepts, ["html"]
|
|
plug :fetch_session
|
|
plug :fetch_live_flash
|
|
plug :put_root_layout, html: {IntisyncWeb.Layouts, :hub_root}
|
|
plug :protect_from_forgery
|
|
plug :put_secure_browser_headers
|
|
end
|
|
|
|
scope "/", IntisyncWeb do
|
|
pipe_through :browser
|
|
|
|
live "/", LobbyLive
|
|
live "/sessions/:id/remote", RemoteLive
|
|
end
|
|
|
|
scope "/", IntisyncWeb do
|
|
pipe_through :hub
|
|
live "/sessions/:id", HubLive
|
|
end
|
|
|
|
# Enable LiveDashboard in development
|
|
if Application.compile_env(:intisync, :dev_routes) do
|
|
# If you want to use the LiveDashboard in production, you should put
|
|
# it behind authentication and allow only admins to access it.
|
|
# If your application does not have an admins-only section yet,
|
|
# you can use Plug.BasicAuth to set up some basic authentication
|
|
# as long as you are also using SSL (which you should anyway).
|
|
import Phoenix.LiveDashboard.Router
|
|
|
|
scope "/dev" do
|
|
pipe_through :browser
|
|
|
|
live_dashboard "/dashboard", metrics: IntisyncWeb.Telemetry
|
|
end
|
|
end
|
|
end
|