Serving parts of the local file system.
Documentation
Serve single directory by combining the hDirectoryResource
and
hFileResource
handlers in the hFileTypeDispatcher
.
Serve single directory like hFileSystem
but do not show directory indices.
Instead of an directory index an Forbidden
response will be created.
:: (MonadIO m, HttpM' m, SendM m) | |
=> (FilePath -> m ()) | Handler to invoke in case of directory. |
-> (FilePath -> m ()) | Handler to invoke in case of regular files. |
-> FilePath | Directory to serve. |
-> m () |
Dispatch based on file type; regular files or directories. The first handler specified will be invoked in case the resource to be served is an directory, the second handler otherwise. The path from the request URI will be appended to the directory resource specified as a parameter, this new path will be used to lookup the real resource on the file system. Every request will be jailed in the specified directory resource to prevent users from requesting arbitrary parts of the file system.