HawkExDashboard.Router (hawk_ex_dashboard v0.1.0)

Copy Markdown View Source

Router integration for HAWK_EX Dashboard.

Usage

In your Phoenix router:

defmodule MyAppWeb.Router do
  use Phoenix.Router
  import HawkExDashboard.Router

  scope "/" do
    # Protect with your existing auth pipeline
    pipe_through [:browser, :require_admin]

    hawk_ex_dashboard "/hawk_ex"
  end
end

This mounts the dashboard at /hawk_ex with the following routes:

/hawk_ex               Overview
/hawk_ex/billing       Billing
/hawk_ex/audit         Audit Logs
/hawk_ex/csv           CSV Exports

Summary

Functions

Mounts the HAWK_EX dashboard at the given path.

Functions

hawk_ex_dashboard(path, opts \\ [])

(macro)

Mounts the HAWK_EX dashboard at the given path.

Options

  • :live_socket_path — the path to the LiveView socket. Defaults to "/live".

Example

hawk_ex_dashboard "/hawk_ex"

# With options
hawk_ex_dashboard "/hawk_ex", live_socket_path: "/custom_live"