wai-app-static-1.1.2: WAI application for static serving

Safe HaskellNone

Network.Wai.Application.Static

Contents

Description

Static file serving for WAI.

Synopsis

WAI application

Settings

Generic, non-WAI code

Mime types

Mime type by file extension

takeExtensions :: FilePath -> [FilePath]Source

A list of all possible extensions, starting from the largest.

mimeTypeByExtSource

Arguments

:: MimeMap 
-> MimeType

default mime type

-> FilePath 
-> MimeType 

Finding files

Directory listings

type Listing = Pieces -> Folder -> IO ByteStringSource

Lookup functions

Embedded

Redirecting

Other data types

toFilePath :: FilePath -> FilePathSource

System.Directory functions are a lie: they claim to be using String, but it's really just a raw byte sequence. We're assuming that non-Windows systems use UTF-8 encoding (there was a discussion regarding this, it wasn't an arbitrary decision). So we need to encodedecode the byte sequence tofrom UTF8. That's the use case for fixPathName/unfixPathName. I'm starting to use John Millikin's system-filepath package for some stuff with work, and might consider migrating over to it for this in the future.