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.Staticmatches 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:onlythat 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).:content_types- controls custom MIME type mapping. It can be a map with filename as key and content type as value to override the default type for matching filenames. Alternatively, it can befalseto opt out of setting the content type header. Defaults to manifest content types.