BB.LiveView.Router (bb_liveview v0.2.3)
View SourceProvides router helpers for mounting the BB Dashboard.
Usage
In your Phoenix router:
import BB.LiveView.Router
scope "/" do
pipe_through :browser
bb_dashboard "/robot", robot: MyRobot
endThe dashboard can be mounted multiple times at different paths for different robots:
bb_dashboard "/arm", robot: ArmRobot
bb_dashboard "/base", robot: BaseRobotOptions
:robot- Required. The robot module to control. Must define arobot/0function.
Authentication
Protect the dashboard using standard Phoenix pipelines:
pipeline :admin do
plug MyAppWeb.RequireAdmin
end
scope "/admin" do
pipe_through [:browser, :admin]
bb_dashboard "/robot", robot: MyRobot
end
Summary
Functions
Defines routes for mounting the BB Dashboard at the given path.