View Source PhoenixAssetPipeline.Plug (phoenix_asset_pipeline v1.0.15)
A plug for serving pre-compiled assets and static files.
Options
:only
- filters which requests to serve. This is useful to avoid file system access on every request when this plug is mounted at"/"
. For example, ifonly: ["images", "favicon.ico"]
is specified, only files in the "images" directory and the "favicon.ico" file will be served byPlug.Static
. Note thatPlug.Static
matches these filters against request uri and not against the filesystem. When requesting a file with name containing non-ascii or special characters, you should use urlencoded form. For example, you should writeonly: ["file%20name"]
instead ofonly: ["file name"]
. Defaults tonil
(no filtering).:only_matching
- a relaxed version of:only
that will serve any request as long as one of the given values matches the given path. For example,only_matching: ["images", "favicon"]
will match any request that starts at "images" or "favicon", be it "/images/foo.png", "/images-high/foo.png", "/favicon.ico" or "/favicon-high.ico". Such matches are useful when serving digested files at the root. Defaults tonil
(no filtering).