# `Image.Plug.SourceResolver.Composite`
[🔗](https://github.com/elixir-image/image_plug/blob/v0.1.0/lib/image/plug/source_resolver/composite.ex#L1)

Source resolver that dispatches by `Image.Plug.Source.kind` to a
configured set of per-kind resolvers.

This is the resolver most hosts will use: a single `Image.Plug`
configuration handles every URL form the Cloudflare provider can
produce (file paths, absolute URLs, hosted asset ids).

### Configuration

Each per-kind sub-resolver is configured as a keyword under its
kind name. Sub-resolver options are passed through verbatim.

* `:file` — keyword list passed to `Image.Plug.SourceResolver.File`.

* `:http` — keyword list passed to `Image.Plug.SourceResolver.HTTP`.

* `:hosted` — `{module, options}` for the host's hosted-asset
  resolver. There is no built-in implementation in v0.1; hosts
  plug their own asset store in here.

Example:

    {Image.Plug.SourceResolver.Composite,
     file:   [root: "priv/static/uploads"],
     http:   [allowed_hosts: ["assets.example.com"]],
     hosted: {MyApp.AssetResolver, table: :my_assets}}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
