Static file serving for WAI.
- staticApp :: StaticSettings -> Application
- defaultWebAppSettings :: FilePath -> StaticSettings
- webAppSettingsWithLookup :: FilePath -> ETagLookup -> StaticSettings
- defaultFileServerSettings :: FilePath -> StaticSettings
- embeddedSettings :: [(FilePath, ByteString)] -> StaticSettings
- data StaticSettings
- ssLookupFile :: StaticSettings -> Pieces -> IO LookupResult
- ssMkRedirect :: StaticSettings -> Pieces -> ByteString -> ByteString
- ssGetMimeType :: StaticSettings -> File -> IO MimeType
- ssListing :: StaticSettings -> Maybe Listing
- ssIndices :: StaticSettings -> [Piece]
- ssMaxAge :: StaticSettings -> MaxAge
- ssRedirectToIndex :: StaticSettings -> Bool
Settings optimized for a web application. Files will have aggressive caching applied and hashes calculated, and indices and listings are disabled.
defaultWebAppSettings, but additionally uses a specialized
ETagLookup in place of the standard one. This can allow you to cache your
hash values, or even precompute them.
Settings optimized for a file server. More conservative caching will be applied, and indices and listings are enabled.
Serve the list of path/content pairs directly from memory.
All of the settings available to users for tweaking wai-app-static.
Note that you should use the settings type approach for modifying values. See http://www.yesodweb.com/book/settings-types for more information.
Lookup a single file or folder. This is how you can control storage backend (filesystem, embedded, etc) and where to lookup.
Given a requested path and a new destination, construct a string that will go there. Default implementation will use relative paths.
Determine the mime type of the given file. Note that this function
IO in case you want to perform more complicated mimetype
analysis, such as via the
How to perform a directory listing. Optional. Will be used when the user requested a folder.
Ordered list of filenames to be used for indices. If the user requests a folder, and a file with the given name is found in that folder, that file is served. This supercedes any directory listing.