Topical.Adapters.Cowboy.RestHandler (topical v0.2.2)

A REST-ish handler adapter for a Cowboy web server.

options

Options

  • registry - The name of the Topical registry. Required.
  • init - A function called before starting/capturing the topic, passed the request. The function must return {:ok, context} for the connection to be accepted. This context is then passed to topics.

example

Example

:cowboy_router.compile([
  {:_,
   [
     # ...
     {"/topics/[...]", RestHandler, registry: MyApp.Topical}
   ]}
])