View Source Routex.Backend (Routex v1.1.0)
use Routex.Backend
When use'd this module generates a Routex backend module and
a configuration struct using the configure/2
callbacks of
the extensions provided in opts
.
See also: Routex Extensions.
Example
iex> defmodule MyApp.RtxBackend do
...> use Routex.Backend,
...> extensions: [
...> Routex.Extension.VerifiedRoutes,
...> Routex.Extension.AttrGetters,
...> ],
...> extension_x_config: [key: "value"]
...> end
iex> IO.inspect(%MyApp.RtxBackend{})
%MyApp.RtxBackend{
extension_x_config: [key: "value"],
extensions: [Routex.Extension.VerifiedRoutes, Routex.Extension.AttrGetters],
verified_sigil_routex: "~l",
verified_sigil_original: "~o"
}
Values in the configuration can be overridden by providing an override map to the :private
option of a scope or route.
Example
live /products, MyApp.Web.ProductIndexLive, :index, private: %{rtx: %{overridden_key: value}}
Summary
Types
@type t() :: module()
A Routex backend module