mix phoenix_datastar.install (PhoenixDatastar v0.1.13)

Copy Markdown View Source

Installs PhoenixDatastar into your Phoenix application.

Usage

mix phoenix_datastar.install

This will:

  1. Add the Registry to your application's supervision tree
  2. Enable stripping of debug annotations in dev (for SSE patches)
  3. Add import PhoenixDatastar.Router to your router
  4. Add "sse" to the browser pipeline's :accepts plug
  5. Add def live_datastar and def datastar to your web module
  6. Add the Datastar JavaScript to your root layout