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
- type Pieces = [Text]
- pathFromPieces :: FilePath -> Pieces -> FilePath
- data MetaData
- = FileMetaData { }
- | FolderMetaData { }
- mdIsFile :: MetaData -> Bool
- getMetaData :: FilePath -> FilePath -> IO (Maybe MetaData)
- type Listing = Pieces -> FilePath -> IO ByteString
- defaultListing :: Listing
- defaultDirListing :: StaticDirListing
- staticApp :: StaticSettings -> Application
- staticAppPieces :: StaticSettings -> Pieces -> Application
- data StaticSettings = StaticSettings {
- ssFolder :: FilePath
- ssMkRedirect :: Pieces -> ByteString -> ByteString
- ssGetMimeType :: FilePath -> IO MimeType
- ssDirListing :: StaticDirListing
- ssCacheSettings :: CacheSettings
- defaultStaticSettings :: CacheSettings -> StaticSettings
- defaultPublicSettings :: CacheSettings -> StaticSettings
- data CacheSettings
- unfixPathName :: FilePath -> FilePath
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
pathFromPieces :: FilePath -> Pieces -> FilePathSource
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
defaultDirListing :: StaticDirListingSource
WAI application
Settings
data StaticSettings Source
StaticSettings | |
|
data CacheSettings Source