LegionWeb.Router (LegionWeb v0.3.0)

View Source

Provides the legion_dashboard/2 macro for mounting the Legion dashboard into a Phoenix router.

Usage

defmodule MyAppWeb.Router do
  use Phoenix.Router
  import LegionWeb.Router

  scope "/" do
    pipe_through :browser
    legion_dashboard "/legion"
  end
end

Options

  • :as — override the route name; defaults to :legion_dashboard

  • :csp_nonce_assign_key — CSP nonce keys for authenticating assets. May be nil, a single atom, or a map of atoms. Defaults to nil.

  • :on_mount — additional module callbacks invoked when the dashboard mounts

  • :socket_path — phoenix socket path for live communication, defaults to "/live"

  • :transport — phoenix socket transport, "websocket" or "longpoll", defaults to "websocket"

Summary

Functions

Defines a Legion dashboard route.

Functions

legion_dashboard(path, opts \\ [])

(macro)

Defines a Legion dashboard route.

It requires a path where to mount the dashboard at and allows options to customize routing.