webgear-core-1.0.4: Composable, type-safe library to build HTTP APIs
Safe HaskellSafe-Inferred
LanguageHaskell2010

WebGear.Core.Handler.Static

Description

Handlers for serving static resources

Synopsis

Documentation

serveDir Source #

Arguments

:: (MonadIO m, Handler h m, Sets h [Status, RequiredHeader "Content-Type" MimeType, Body ByteString] Response) 
=> FilePath

The directory to serve

-> Maybe FilePath

Optional index filename for the root directory. A 404 Not Found response will be returned for requests to the root path if this is set to Nothing.

-> h (Linked req Request) Response 

Serve files under the specified directory.

serveFile :: (MonadIO m, Handler h m, Sets h [Status, RequiredHeader "Content-Type" MimeType, Body ByteString] Response) => h FilePath Response Source #

Serve a file specified by the input filepath.