|
Happstack.Server.HTTP.FileServe |
|
|
|
Synopsis |
|
type MimeMap = Map String String | | blockDotFiles :: (Request -> IO Response) -> Request -> IO Response | | doIndex :: (ServerMonad m, FilterMonad Response m, MonadIO m) => [String] -> MimeMap -> String -> m Response | | doIndexStrict :: (ServerMonad m, FilterMonad Response m, MonadIO m) => [String] -> MimeMap -> String -> m Response | | errorwrapper :: (MonadIO m, MonadPlus m, FilterMonad Response m) => String -> String -> m Response | | fileServe :: (WebMonad Response m, ServerMonad m, FilterMonad Response m, MonadIO m) => [FilePath] -> FilePath -> m Response | | fileServeStrict :: (ServerMonad m, FilterMonad Response m, MonadIO m) => [FilePath] -> FilePath -> m Response | | isDot :: String -> Bool | | mimeTypes :: MimeMap |
|
|
Documentation |
|
|
|
|
Prevents files of the form '.foo' or 'bar/.foo' from being served
|
|
|
|
|
A variant of doIndex that relies on getFileStrict
|
|
|
|
|
:: (WebMonad Response m, ServerMonad m, FilterMonad Response m, MonadIO m) | | => [FilePath] | index files if the path is a directory
| -> FilePath | file/directory to serve
| -> m Response | | Serve a file (lazy version). For efficiency reasons when serving large
files, will escape the computation early if a file is successfully served,
to prevent filters from being applied; if a filter were applied, we would
need to compute the content-length (thereby forcing the spine of the
ByteString into memory) rather than reading it from the filesystem.
Note that using lazy fileServe can result in some filehandles staying open
until the garbage collector gets around to closing them.
|
|
|
|
:: (ServerMonad m, FilterMonad Response m, MonadIO m) | | => [FilePath] | index files if the path is a directory
| -> FilePath | file/directory to serve
| -> m Response | | Serve a file (strict version). Reads the entire file strictly into
memory, and ensures that the handle is properly closed. Unlike lazy
fileServe, this function doesn't shortcut the computation early, and it
allows for filtering (ex: gzip compression) to be applied
|
|
|
|
Returns True if the given String either starts with a . or is of the form
foo/.bar, e.g. the typical *nix convention for hidden files.
|
|
|
Ready collection of common mime types.
|
|
Produced by Haddock version 2.4.2 |