OrionWeb.Router (Orion v1.0.7)

View Source

Provides LiveView routing for Orion.

Summary

Functions

Define an Orion route.

Functions

live_orion(path, opts \\ [])

(macro)

Define an Orion route.

It expects the path Orion will be mounted at and a set of options

All the Orion Pages will be under a live_session.

## Options

  • :live_socket_path - Configures the socket path. it must match the socket "/live", Phoenix.LiveView.Socket in your endpoint.

  • :csp_nonce_assign_key - an assign key to find the CSP nonce value used for assets. Supports either atom() or a map of type %{optional(:img) => atom(), optional(:script) => atom(), optional(:style) => atom()}

  • :on_mount - Pass a list of on_mount hooks to live_session, like if you want to validate authentication with :on_mount. See the phoenix_liveview docs

  • :live - Configure options to inject into the Orion route

  • :self_profile - Configure if the tracing is applied to the node running Orion itself, default to true

  • :fake_data - Configure if the tracing form allow you to run with fake data, default to false

Examples

defmodule MyAppWeb.Router do
  use Phoenix.Router
  import OrionWeb.Router
  scope "/", MyAppWeb do
    pipe_through [:browser]
    live_orion "/orion",
      on_mount: {MyAppWeb.SomeHook, :admin}
  end
end