Phoenix Plug that routes requests to PgRest resources.
Usage
# In your router:
forward "/api", PgRest.Plug, repo: MyApp.RepoOptions
:repo(required) - The Ecto repo module:json- JSON encoder/decoder module (default:Jason):max_limit- Maximum rows per request, like PostgREST'sdb-max-rows(default:nil= no limit):context_builder- A 2-arity function(conn, opts) -> context_mapfor custom context building
Summary
Functions
@spec call(Plug.Conn.t(), map()) :: Plug.Conn.t()
Routes incoming requests to the appropriate resource handler.
Matches /:resource and /:resource/:id paths, resolving the resource
via PgRest.Registry and dispatching to the correct CRUD operation.
Initializes plug options.
Requires :repo. Optional: :json (default Jason), :max_limit,
:context_builder, :authorization.