View Source AshJsonApi.Router (ash_json_api v1.2.0)

Use this module to create a router for your AshJsonApi.

To use this, create a module and do the following:

defmodule YourRouter do
  use AshJsonApi.Router,
    domains: [YourDomain, YourOtherDomain],
    # these next two are optional, only add them if you want those endpoints
    open_api: "/open_api",
    json_schema: "/json_schema"

Then in your Phoenix router or plug pipeline, forward to this plug. In phoenix, that looks like this:

    forward "/api", YourRouter