Mounts Chime in the app's router.
import Chime.Router
scope "/api" do
pipe_through :api_authenticated
chime_api "/notifications"
end
# The links of the emails: no session, no CSRF token, as a mail
# client posts the one to unsubscribe (RFC 8058).
pipeline :mail do
plug :accepts, ["html"]
end
scope "/" do
pipe_through :mail
chime_mail "/notifications/mail"
endchime_api/2 mounts the feed and the preferences as JSON, for a
frontend that Phoenix does not render (see Chime.API and the
Any frontend guide), and chime_mail/2 the
addresses of the emails' links, to unsubscribe and to open a
notification (see Chime.Router.Mail), at the config's :mail_url.
Each is a library mounted with
PhoenixMountable: ordinary
routes in the app's router (mix phx.routes lists them), behind the
app's own scopes and pipelines.
The LiveViews of the app need no mount: Chime.Live and
Chime.Components go in them.
Summary
Functions
Mounts the admin at path: see Chime.Router.Admin.
Mounts Chime.Router at path in a host router.
Mounts the addresses of the emails' links at path, the config's
:mail_url: see Chime.Router.Mail.
Functions
Mounts the admin at path: see Chime.Router.Admin.
Mounts Chime.Router at path in a host router.
import Chime.Router
scope "/" do
pipe_through :browser
chime_api "/chime"
endOptions
:token_max_age(pos_integer/0) - How long a token ofChime.Tokenis valid, in seconds. The default value is86400.
Every mount also takes the options listed in PhoenixMountable, such as
:as, :on_mount and :csp_nonce_assign_key.
Mounts the addresses of the emails' links at path, the config's
:mail_url: see Chime.Router.Mail.