OrionWeb.Router (Orion v1.0.7)
View SourceProvides LiveView routing for Orion.
Summary
Functions
Define an Orion route.
Functions
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 thesocket "/live", Phoenix.LiveView.Socketin your endpoint.:csp_nonce_assign_key- an assign key to find the CSP nonce value used for assets. Supports eitheratom()or a map of type%{optional(:img) => atom(), optional(:script) => atom(), optional(:style) => atom()}:on_mount- Pass a list ofon_mounthooks 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