- hFile :: (MonadIO m, HttpM' m, SendM m) => m ()
- hFileResource :: (MonadIO m, HttpM' m, SendM m) => FilePath -> m ()
- fileMime :: FilePath -> Mime
- hFileFilter :: (MonadIO m, HttpM' m, SendM m) => (String -> String) -> m ()
- hFileResourceFilter :: (MonadIO m, HttpM Response m, SendM m) => (String -> String) -> FilePath -> m ()
- hResource :: HttpM Request m => (FilePath -> m a) -> m a
- hUri :: HttpM Request m => (Uri -> m a) -> m a
Documentation
hFile :: (MonadIO m, HttpM' m, SendM m) => m ()Source
Like hFileResource
but uses the path of the current request URI.
hFileResource :: (MonadIO m, HttpM' m, SendM m) => FilePath -> m ()Source
Serve a file from the filesystem indicated by the specified filepath. When
there is some kind of IOError
the hSafeIO
function will be used to produce a
corresponding error response. The contentType
will be the mime-type based on
the filename extension using the mimetype
function. The contentLength
will
be set the file's size.
hFileFilter :: (MonadIO m, HttpM' m, SendM m) => (String -> String) -> m ()Source
Like hFileResourceFilter
but uses the path of the current request URI.
hFileResourceFilter :: (MonadIO m, HttpM Response m, SendM m) => (String -> String) -> FilePath -> m ()Source
Like the hFileResource
handler, but with a custom filter over the content.
This function will assume the content is an UTF-8 encoded text file. Because of
the possibly unpredictable behavior of the filter, no contentLength
header
will be set using this handler.