Building router helpers
One of the most used features of the Phoenix router is the helper functions defined in a router helper module. Phoenix generates this module when a router is compiled. However, to keep our compilation simple, we can decouple router helper modules from the router and define Goldcrest.Router.Helpers
, which can be used to define a helper module:
defmodule Goldcrest.Router.Helpers do @moduledoc false defmacro __using__(opts) do quote do @opts unquote(opts) @default_router_module __MODULE__ |> Module.split() ...