# `AttachedDashboard.Web.Router`
[🔗](https://github.com/saschabrink/attached_dashboard/blob/v0.2.2/lib/attached_dashboard/web/router.ex#L1)

Phoenix router for the AttachedDashboard.

Also provides the `attached_dashboard/1,2` macro that host apps use to mount
the dashboard at a chosen prefix.

## Usage

    # router.ex
    import AttachedDashboard.Web.Router

    scope "/" do
      pipe_through :browser
      attached_dashboard "/admin/files"
    end

## Options

* `:on_mount` — `on_mount` hooks added to the dashboard's `live_session`. Use this to
  enforce authentication from the host app.
* `:as` — override the route helper name. Defaults to `:attached_dashboard`.
* `:csp_nonce_assign_key` — CSP nonce key (atom or map with `:img`, `:style`, `:script` keys).
* `:backlink` — path in the host app to return to from the dashboard sidebar
  (e.g. `"/admin"`). When set, the sidebar title becomes a link to this path.
  Use a full URL/path string; the target lives outside the dashboard's
  `live_session`, so navigation is a regular request (full page reload).

# `attached_dashboard`
*macro* 

Mounts the AttachedDashboard at the given path in the host app's router.

# `call`

Callback invoked by Plug on every request.

# `formatted_routes`

# `init`

Callback required by Plug that initializes the router
for serving web requests.

# `verified_route?`

---

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