Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Handlers for serving static resources
Synopsis
- serveDir :: (Handler h m, Sets h [Status, RequiredResponseHeader "Content-Type" MimeType, UnknownContentBody] Response) => FilePath -> Maybe FilePath -> h (Request `With` ts) Response
- serveFile :: (Handler h m, Sets h [Status, RequiredResponseHeader "Content-Type" MimeType, UnknownContentBody] Response) => h FilePath Response
Documentation
:: (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 |
-> h (Request `With` ts) Response |
Serve files under the specified directory.