# `Monitorex.Router`

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

# `http_dashboard`
*macro* 

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.CustomLive

This 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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
