View Source Camarero.Catering (camarero v1.0.3)
The DynamicSupervisor to manage all the handlers.
Handlers might be added through config.exs file statically or
via call to route!/1 dynamically. The latter accepts all types of child_spec
acceptable by DynamicSupervisor.start_child/2.
This module is started in the application supervision tree and keeps track on all the handlers.
Summary
Functions
Returns a specification to start this module under a supervisor.
Declares and stores the new route. If the route is already set, logs an error message to the log and acts as NOOP.
Starts the DynamicSupervisor and Camarero.Catering.Routes,
linked to the current process.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec route!(runner :: Supervisor.child_spec() | module()) :: {module(), {module(), module()}, {Plug.Cowboy, keyword()}}
Declares and stores the new route. If the route is already set, logs an error message to the log and acts as NOOP.
@spec start_link(extra_arguments :: keyword()) :: {:ok, pid()} | {:error, {:already_started, pid()} | term()}
Starts the DynamicSupervisor and Camarero.Catering.Routes,
linked to the current process.
Upon start, loads :camarero, :carta config setting and adds routes for all
the statically configured handlers.