Monitorex.Router
(monitorex v0.3.0)
Copy Markdown
Router macros for embedding the Monitorex dashboard in your Phoenix application.
Usage
defmodule MyAppWeb.Router do
use Phoenix.Router
import Monitorex.Router
scope "/monitorex" do
http_dashboard []
end
end
Summary
Functions
Defines the Monitorex HTTP dashboard routes.
Functions
Defines the Monitorex HTTP dashboard routes.
Options
:live_view— module to use as the dashboard LiveView (default:Monitorex.DashboardLive):layout— root layout module (default:{Monitorex.Layouts, :root}):assets_path— asset mount path (default:"/dashboard-assets"):on_mount— additional on_mount hooks (default:[Monitorex.Authentication])
Example
http_dashboard live_view: MyApp.CustomLiveThis generates:
live_session :monitorex_dashboard,
root_layout: {Monitorex.Layouts, :root},
on_mount: [Monitorex.Authentication] do
get "/dashboard-assets/*path", Monitorex.Assets, :call
live "/", Monitorex.DashboardLive, :index
live "/:page", Monitorex.DashboardLive, :index
live "/:page/:host", Monitorex.DashboardLive, :index
end