Static file serving for WAI.
- type MimeType = ByteString
- defaultMimeType :: MimeType
- type Extension = String
- type MimeMap = Map Extension MimeType
- takeExtensions :: FilePath -> [String]
- defaultMimeTypes :: MimeMap
- mimeTypeByExt :: MimeMap -> MimeType -> FilePath -> MimeType
- defaultMimeTypeByExt :: FilePath -> MimeType
- data CheckPieces
- checkPieces :: FilePath -> [FilePath] -> [String] -> IO CheckPieces
- data MetaData
- = FileMetaData { }
- | FolderMetaData { }
- mdIsFile :: MetaData -> Bool
- getMetaData :: FilePath -> FilePath -> IO (Maybe MetaData)
- type Listing = [String] -> FilePath -> IO ByteString
- defaultListing :: Listing
- data StaticSettings = StaticSettings {}
- staticApp :: StaticSettings -> Application
- staticAppPieces :: StaticSettings -> [Text] -> Application
Generic, non-WAI code
Mime types
type MimeType = ByteStringSource
Mime type by file extension
takeExtensions :: FilePath -> [String]Source
A list of all possible extensions, starting from the largest.
Finding files
:: FilePath | static file prefix |
-> [FilePath] | List of default index files. Cannot contain slashes. |
-> [String] | parsed request |
-> IO CheckPieces |
File/folder metadata
:: FilePath | path to directory on disk containing the entry |
-> FilePath | entry in that directory |
-> IO (Maybe MetaData) |
look up the meta data associated with a file
Directory listings
WAI application
data StaticSettings Source
staticAppPieces :: StaticSettings -> [Text] -> ApplicationSource