wai-app-static-3.1.7.2: WAI application for static serving

Network.Wai.Application.Static

Description

Static file serving for WAI.

Synopsis

# WAI application

Turn a StaticSettings into a WAI application.

## Default Settings

Arguments

 :: FilePath root folder to serve from -> StaticSettings

Settings optimized for a web application. Files will have aggressive caching applied and hashes calculated, and indices and listings are disabled.

Arguments

 :: FilePath root folder to serve from -> ETagLookup -> StaticSettings

Same as 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.

Arguments

 :: FilePath root folder to serve from -> StaticSettings

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.

## Settings

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 lives in IO in case you want to perform more complicated mimetype analysis, such as via the file utility.

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.

Value to provide for max age in the cache-control.

If True, send a redirect to the user when a folder is requested and an index page should be displayed. When False, display the content immediately.

Force a trailing slash at the end of directories

Optional Application to be used in case of 404 errors

Since 3.1.3