webgear-core-1.1.1: 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

:: (Handler h m, Sets h [Status, RequiredResponseHeader "Content-Type" MimeType, UnknownContentBody] 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 (Request `With` ts) Response 

Serve files under the specified directory.

serveFile :: (Handler h m, Sets h [Status, RequiredResponseHeader "Content-Type" MimeType, UnknownContentBody] Response) => h FilePath Response Source #

Serve a file specified by the input filepath.