# `PhoenixDatastar.PageController`
[🔗](https://github.com/RicoTrevisan/phoenix_datastar/blob/v0.2.0/lib/page_controller.ex#L1)

Controller for rendering the initial PhoenixDatastar page.

Generates session ID, starts GenServer, and renders the initial HTML.

By default, `PhoenixDatastar.DefaultHTML` is used as the mount template.
To customize the wrapper, you can override it:

1. Globally via application config:

    config :phoenix_datastar, :html_module, MyAppWeb.DatastarHTML

2. Per-route via the `datastar/3` macro:

    datastar "/counter", CounterStar, html_module: MyAppWeb.DatastarHTML

See `PhoenixDatastar.DefaultHTML` for a custom module example.

# `mount`

```elixir
@spec mount(Plug.Conn.t(), map()) :: Plug.Conn.t()
```

Mounts a Datastar view.

Expects `conn.private.datastar` to contain:
  * `:view` - The view module
  * `:path` - The base path
  * `:html_module` - Optional HTML module override (defaults to `PhoenixDatastar.DefaultHTML`)

---

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