PhoenixFlags.Router (PhoenixFlags v0.9.0)

Copy Markdown View Source

Provides a router macro for mounting the PhoenixFlags dashboard.

Usage

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

  scope "/admin" do
    pipe_through [:browser, :require_admin]

    flags_dashboard "/flags",
      config: MyApp.SystemConfig
  end
end

Options

  • :config (required) — the module that use PhoenixFlags
  • :on_mount — list of Phoenix.LiveView.on_mount/1 hooks to add to the live session (e.g. for authentication)
  • :live_socket_path — defaults to "/live"
  • :app_js — path to the host application's JS bundle, which must connect a LiveSocket. Defaults to "/assets/js/app.js".

Summary

Functions

Defines routes for the PhoenixFlags dashboard.

Functions

flags_dashboard(path, opts)

(macro)

Defines routes for the PhoenixFlags dashboard.