salvia-1.0.0: Modular web application framework.

Network.Salvia.Handler.FileSystem

Description

Serving parts of the local file system.

Synopsis

Documentation

hFileSystemSource

Arguments

:: (MonadIO m, HttpM' m, SendM m) 
=> FilePath

Directory to serve.

-> m () 

Serve single directory by combining the hDirectoryResource and hFileResource handlers in the hFileTypeDispatcher.

hFileSystemNoIndexesSource

Arguments

:: (MonadIO m, HttpM' m, SendM m) 
=> FilePath

Directory to serve.

-> m () 

Serve single directory like hFileSystem but do not show directory indices. Instead of an directory index an Forbidden response will be created.

hFileTypeDispatcherSource

Arguments

:: (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.