Caravela.Gen.LiveRoute (Caravela v0.5.1)

Copy Markdown View Source

Renders the live router snippet for a Caravela domain's generated LiveViews, analogous to Caravela.Gen.RouterScope for the JSON API.

Caravela does not edit router.ex automatically. Instead, the mix task prints the exact scope + live lines and the developer pastes them. Routes mirror the generator's own path convention:

/library/books
/library/books/new
/library/books/:id
/library/books/:id/edit

When the domain declares version "v1", the scope prefix shifts to /v1/library/... and the web-module alias picks up the V1. segment, matching Caravela.Gen.LiveView's module layout.

Summary

Functions

Return the router snippet for live routes as a string.

Functions

render(domain)

Return the router snippet for live routes as a string.