LiveDashboard v0.2.3 Phoenix.LiveDashboard.Router View Source
Provides LiveView routing for LiveDashboard.
Link to this section Summary
Functions
Defines a LiveDashboard route.
Link to this section Functions
Defines a LiveDashboard route.
It expects the path
the dashboard will be mounted at
and a set of options.
Options
:metrics
- Configures the module to retrieve metrics from. It can be amodule
or a{module, function}
. If nothing is given, the metrics functionality will be disabled.:env_keys
- Configures environment variables to display. It is defined as a list of string keys. If not set, the environment information will not be displayed.:live_socket_path
- Configures the socket path. it must match thesocket "/live", Phoenix.LiveView.Socket
in your endpoint.
Examples
defmodule MyAppWeb.Router do
use Phoenix.Router
import Phoenix.LiveDashboard.Router
scope "/", MyAppWeb do
pipe_through [:browser]
live_dashboard "/dashboard",
metrics: {MyAppWeb.Telemetry, :metrics},
env_keys: ["APP_USER", "VERSION"]
end
end