hails-0.1.1: IFC enforcing web platform framework

Safe HaskellUnsafe

Hails.IterIO.HailsRoute

Documentation

routeFileSysSource

Arguments

:: LabelState l p st 
=> (String -> ByteString)

Map of file suffixes to mime types (see mimeTypesI)

-> (FilePath -> HttpRoute (LIO l p st) s)

Handler to invoke when the URL maps to a directory in the file system. Reasonable options include:

  • (const mempty) to do nothing, which results in a 403 forbidden,
  • (dirRedir "index.html") to redirect directory accesses to an index file, and
  • a recursive invocation such as (routeFileSys typemap . (++ "/index.html")) to re-route the request directly to an index file.
-> FilePath

Pathname of directory to serve from file system

-> HttpRoute (LIO l p st) s