Literature.Router (literature v0.4.7)
Provides LiveView routing for literature.
Summary
Functions
Defines a Literature route.
Defines a Literature API route.
Defines routes for Literature static assets.
Defines a Literature dashboard route.
Functions
Defines a Literature route.
It requires a path where to mount the public page at and allows options to customize routing.
Examples
Mount a blog
at the path "/blog":
defmodule MyAppWeb.Router do
use Phoenix.Router
use Literature.Router
scope "/", MyAppWeb do
pipe_through [:browser]
literature "/blog"
end
end
Defines a Literature API route.
Examples
defmodule MyAppWeb.Router do
use Phoenix.Router
use Literature.Router
literature_api "/api"
end
Defines routes for Literature static assets.
Static assets should not be CSRF protected. So they need to be mounted in your router in a different pipeline.
It can take the path
the literature assets will be mounted at.
Usage
# lib/my_app_web/router.ex
use MyAppWeb, :router
import Literature.Router
...
scope "/" do
literature_assets("/")
end
Defines a Literature dashboard route.
It requires a path where to mount the dashboard at and allows options to customize routing.
Examples
Mount an literature
dashboard at the path "/literature":
defmodule MyAppWeb.Router do
use Phoenix.Router
use Literature.Router
scope "/", MyAppWeb do
pipe_through [:browser]
literature_dashboard "/literature"
end
end